Publishing 0.1.9: Crash, redirect-loop and denial-of-service fixes
Publishing 0.1.9 is a quality sweep. Its main fix: a post whose versions shared identical content could crash its public page when looked up by URL slug. Lookups now use the post’s live version.
Other fixes:
- Two ways to exhaust server memory are closed: unknown tags in post components, and requests for groups that do not exist.
- A language switch with an empty
?in the address no longer loops on its own redirect. - Public URLs work when PhoenixKit is mounted under a prefix such as
/phoenix_kit. - Publishing and unpublishing lock the post, so simultaneous actions cannot leave it pointing at the wrong version.
- An old URL slug no longer redirects to a post that was never published.
- A user who only watches an edit can no longer delete a translation.
- The archive action now really stores the version as archived.
- More public and editor texts are translatable, and the admin edit link opens the editor in the language the reader was viewing.
Full release notes: Publishing 0.1.9
0.1.9 · 19 May 2026
PR #16 — Phase 2 quality sweep (URL-slug correctness, DoS guards, race fixes, archive semantics, host boundaries) + post-merge review fixes + the phoenix_kit 1.7.114 upgrade.
Fixed
Ecto.MultipleResultsErroron URL-slug post lookups. Posts that accumulated several versions sharing identical content fields crashedrepo().one(). URL-slug resolution is now scoped to the post’s active version (public path) with a deterministic tie-break.- Two DoS vectors closed. (1) The PHK page-builder XML parser used
String.to_atom/1on admin-supplied tag names — arbitrary tags could exhaust the finite BEAM atom table and crash the VM. It now usesString.to_existing_atom/1, routing unknown tags to:unknown. (2)ListingCacheminted a never-GC’d:persistent_termentry for every unknown URL segment treated as a group slug; it now verifies the group exists before writing (each write also triggers a global GC pass — a flood of bad requests was a DoS on top of the leak). - Language-switch redirect loop on a trailing
?.build_public_path/2encoded an empty query map to"foo?", which never equals the canonical"foo", so the 301 looped to itself. Empty params now produce no?. - Public URLs broke under a non-root workspace prefix.
RouterDispatchgainedmaybe_rewrite/2, which strips/re-prepends the host’surl_prefixso dispatch works when PhoenixKit is mounted under e.g./phoenix_kit. - Publish/unpublish races. Both
do_publish_version/4anddo_unpublish_post/3now take aSELECT … FOR UPDATElock on the post row (sharedlock_post!/2helper) so concurrent publishes/unpublishes can’t interleave into a staleactive_version_uuid. Timestamp-modecreate_postretries the whole transaction on a(group_uuid, post_date, post_time)unique-constraint violation instead of failing. find_by_previous_url_slug/3surfaced unpublished posts — a public 301 redirect could resolve onto a never-published post that then 404s. Now scoped to the active version only.clear_translationeditor event was unguarded — a spectator/locked-out viewer could hard-delete a translation row by sending the event directly over the socket. Now gated like every other destructive editor event.
Added
find_by_url_slug_any_version/3(Posts/DBStorage) — internal lookup that surfaces unpublished drafts, for the stale-language self-healing flow and slug-uniqueness checks. The publicfind_by_url_slug/3stays published-only.unpublish_post:target_statusoption — the “Archived” UI action now persistsstatus: "archived"on the version row instead of silently reverting to"draft".terminate/2on theIndex,PostShow, andSettingsLiveViews for subscribe/unsubscribe symmetry.- i18n sweep — previously-hardcoded UI strings on the public listing/post pages and editor now flow through
gettext/ngettext.
Changed
- URL-slug lookup split into a public, published-only path and an internal any-version path; collisions on the public path self-heal by auto-suffixing the loser’s
url_slug. - base→dialect resolution consolidated — three near-identical helpers in
Posts,Web.Controller.Language, andStaleFixercollapse intoLanguageHelpers.resolve_dialect_for_base/3with explicit:prefer/:excludeoptions. - The admin “Edit Post” link now carries the current public-side language via
?lang=so the editor opens in the language the reader was viewing. - Narrowed
rescueclauses inPublishing.dashboard_tabs,load_publishing_groups_for_tabs, andWeb.Previewto catch only expected DB/render exceptions — genuine programmer errors bubble up again instead of being masked. clear_translation/4writes anActivityLogaudit entry, matchingdelete_language.- Bumped
phoenix_kitto~> 1.7.114, which adds the generic:module_assignsattr onLayoutWrapper.app_layout/1;Web.HTMLforwardsphoenix_kit_publishing_translationsandogto the host layout through it. create_post_with_timestamp_retrytakes a single context map instead of nine positional arguments.
Docs
dev_docs/pull_requests/2026/16-phase-2-quality-sweep/—CLAUDE_REVIEW.md(post-merge review) andFOLLOW_UP.md(findings triage +mix precommitrestoration after the upgrade).
Publishing 0.1.9. Install or update: {:phoenix_kit_publishing, "~> 0.1"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.