Skip to content

Entities 0.1.5: Public forms save again, and the activity log names who changed what

Entities 0.1.5 fixes public entity forms, which crashed on every submission, and records more of the module’s changes in PhoenixKit’s activity log.

The public form controller read the entity’s id under an old key that no longer exists, so saving a submission failed. A second error made it crash whenever a submission raised a security flag. Both are fixed.

Activity log entries for creating, updating and deleting entities and records now name the user who did it, and bulk actions, failed changes and switching the module on or off are logged too. Public forms also got stricter: a forwarded client address that is private, loopback or otherwise not public is ignored, and stored metadata strings are capped at 255 characters. Mirror files can no longer be read or written outside the mirror folder.

The admin’s error messages now come from one shared list, and the unused PhoenixKitEntities.Web.DataView page module, which no route used, was removed.

Full release notes: Entities 0.1.5

0.1.5 · 28 April 2026

Fixed

  • entity_form_controller.ex: replace entity.id with entity.uuid (lines 243 + 342) — primary key is :uuid, the previous reference would have crashed every public-form submission with KeyError
  • entity_form_controller.ex: replace runtime-bound logger.warning(...) with Logger.warning(...) macro call — variable-bound macro dispatch raised UndefinedFunctionError on every save_log security flag

Added

  • PhoenixKitEntities.Errors module — central atom→message dispatcher for the 10 user-facing error categories surfaced by the admin LVs and public form
  • Activity logging on every entity + entity_data CRUD path (create / update / delete / bulk operations / module toggle), with actor_uuid threaded from caller opts
  • Public-form security hardening — X-Forwarded-For RFC1918 rejection (loopback / link-local / multicast / private-network octets), metadata size cap (@metadata_string_cap 255), browser/OS/device parsing
  • Mirror.Storage filesystem path containment via Path.expand + boundary-prefix check
  • Test infrastructure — LiveCase, DataCase, Hooks, test endpoint / router / layouts; supports the full LV admin smoke test suite
  • 32 LiveView smoke tests across Web.Entities, Web.EntityForm, Web.DataNavigator, Web.DataForm, Web.EntitiesSettings
  • Coverage push from 31.39% baseline to 75.14% across 5 quality batches (684 tests, 0 failures, 5/5 stable)

Changed

  • Web.Entities and Web.DataNavigator now defer DB queries from mount/3 to handle_params/3 — avoids the duplicate-query-on-mount Phoenix iron-law violation
  • ActivityLog rescue shape canonicalised: Postgrex.Error -> :ok, DBConnection.OwnershipError -> :ok, fallback error -> Logger.warning(...), catch :exit, _ -> :ok
  • Mirror.Storage rescues narrowed from bare rescue _ to [ArgumentError, RuntimeError, FunctionClauseError] for path operations
  • UrlResolver rescues narrowed to a six-class DB-scoped list (no bare _ catches)
  • FieldTypes.description_for/1 literal-clause helper introduced so gettext extraction works on all 12 type descriptions
  • handle_info catch-alls promoted from silent ignore to Logger.debug across all 5 admin LVs
  • @spec backfill on routes.ex (3 functions) and sitemap_source.ex (5 callbacks)
  • mix.exs test_coverage: [ignore_modules: [...]] filter so coverage tracks production code, not test-support boilerplate

Removed

  • PhoenixKitEntities.Web.DataView — unrouted module with no callers anywhere in the workspace; verified via grep + ast-grep across phoenix_kit_entities, phoenix_kit core, and phoenix_kit_parent. Recoverable from git history if a public-display feature materialises later

Entities 0.1.5. Install or update: {:phoenix_kit_entities, "~> 0.1"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.