Publishing 0.1.5: Full activity log and buttons that wait
Publishing 0.1.5 writes every change to posts, groups, versions and translations to the PhoenixKit activity log, including changes that fail, which are marked as not completed.
Admin buttons that start slow or destructive actions now switch to a waiting label, such as Saving…, Translating… or Deleting…, and cannot be clicked twice.
Other fixes:
- Two groups saved with the same slug at the same moment no longer crash on the database’s unique check.
- Repairing old posts runs through them in a stream instead of loading all of them into memory, and retries once with a suffix when two posts would get the same URL slug.
- Saving a post needs fewer database writes.
Upgrading
If your app listens to publishing’s post events through PubSub.posts_topic/1, update it: the created, updated, status-changed and version-created events now carry only the post’s uuid and slug. Load the post again to get the rest.
Full release notes: Publishing 0.1.5
0.1.5 · 28 April 2026
PR #10 — quality sweep + 4 coverage-push batches (33.34% → 63.79% line coverage).
Added
PhoenixKit.Modules.Publishing.Errors— central atom-to-gettext mapping (36 atoms + 4 tagged-tuple shapes) plustruncate_for_log/2to cap unbounded log payloads (AI responses, HTTP errors).PhoenixKit.Modules.Publishing.ActivityLog.log_failed_mutation/5— writes adb_pending: trueaudit row when a user-driven mutation fails, so the audit trail still captures intent on DB constraint failures.- Activity logging on every Posts / Groups / Versions / TranslationManager mutation (success and failure paths).
phx-disable-withon every async / destructive admin button.
Changed
- PubSub payload contract —
broadcast_post_created/2,broadcast_post_updated/2,broadcast_post_status_changed/2, andbroadcast_version_created/2now emit a minimal%{uuid:, slug:}payload instead of the full post map. Receivers should refetch the post viaPublishing.read_post/4(or any of the read helpers) rather than destructuring the broadcast. Internal consumers were already doing this; host apps that subscribe toPubSub.posts_topic/1must update their pattern matches. DBStorage.upsert_group/1rewritten as atomicINSERT ... ON CONFLICT DO UPDATE— closes a TOCTOU race where two concurrent callers with the same slug could both observeniland then crash on the unique index.Web.Settings.mount/3moved DB reads intohandle_params/3(Phoenix iron law:mount/3runs twice per page load).StaleFixer.apply_stale_fix/3retries once on(group_uuid, slug)unique-index conflict using a deterministicpost_uuid[0..8]suffix.StaleFixer.fix_all_stale_values/0now streams posts underRepo.checkout/1so large catalogues don’t hold every post in memory.- Posts save path:
maybe_sync_datetime_and_audit/3consolidates timestamp-mode date sync + audit field updates into a singleupdate_post/2(halves round-trips per save). - Three
rescue _clauses narrowed toUndefinedFunctionError | ArgumentError:LanguageHelpers.reserved_language_code?/1,LanguageHelpers.single_language_mode?/0,Web.Controller.Language.valid_language?/1. Web.Controller.Translations.language_enabled_for_public?/2renamed toexact_enabled_for_public?/2to distinguish fromLanguageHelpers.language_enabled?/2(the looser variant).Workers.TranslatePostWorker.translate_content/4→/3andskip_already_translated/5→/4— dropped unusedgroup_slugparameter (internal callers only).
Fixed
Errors.truncate_for_log/2UTF-8 boundary handling — multibyte input could previously return an invalid binary ifmaxlanded mid-codepoint; clip now walks back to the previous codepoint boundary.
Docs
- Earmark
escape: falsetrust model documented inline inrenderer.ex(admin-authored Markdown only; rewirehtml_sanitize_exif untrusted input ever reachesrender_markdown/1).
Publishing 0.1.5. Install or update: {:phoenix_kit_publishing, "~> 0.1"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.