PhoenixKit. Modules. Publishing. Web. Editor. Persistence
(PhoenixKitPublishing v0.5.1)
Copy Markdown
View Source
Post persistence operations for the publishing editor.
Handles create, update, and save operations for posts, including version creation and translation saving.
Summary
Functions
Performs save operation with validation and routing. Returns {:noreply, socket}.
Refresh available_languages and language_statuses (for language switcher updates).
Regenerates the listing cache for a group.
Reload post when another tab/user saves (last-save-wins).
Reload content after AI translation completes for the current language.
Functions
Performs save operation with validation and routing. Returns {:noreply, socket}.
Refresh available_languages and language_statuses (for language switcher updates).
Regenerates the listing cache for a group.
Reload post when another tab/user saves (last-save-wins).
Unless this socket is holding work of its own. Two tabs open on the same post are both owners when they belong to the same account — presence keys on the user, not the socket — so saving in one told the other to reload, and the reload overwrote whatever had been typed in the meantime and marked it clean. Nothing warned, and there was nothing left to recover from.
A tab with unsaved changes keeps them and is told the row moved underneath it, which is a conflict a person can resolve; the tab that has nothing pending still reloads, which is what makes a reference tab follow along.
Reload content after AI translation completes for the current language.