mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #3050] [Issue]: Persona version restore silently drops savedStatusOptions (not captured in snapshots, not restored), and a savedStatusOptions-only edit creates no version #1619
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#1619
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @kolacheee on GitHub (Jun 29, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/3050
Originally assigned to: @SpicyMarinara on GitHub.
What's wrong
The persona version payload (
PersonaCardSnapshot) has nosavedStatusOptionsfield,buildPersonaSnapshot()never captures it, andrestorePersonaVersion()'s UPDATE set clause omits it. So saved persona versions never recordsavedStatusOptions, and restoring an older version leavessavedStatusOptionsstuck at its CURRENT value instead of reverting it. A user rolling a persona back via version history gets every field reverted except their Conversation-mode saved status text options. As a secondary effect, because the snapshot omits the field, a PATCH that changes ONLYsavedStatusOptionsproduces an identical before/after snapshot, sopersonaSnapshotChangedreturns false and no version is created — that change is unversioned.How to reproduce (try it yourself)
savedStatusOptionsto ['Working'], and save in a way that creates version V1 (via another tracked field change).savedStatusOptionsto ['Sleeping'] AND a tracked field, save (V2).You'll see: name/description/etc. revert to V1, but
savedStatusOptionsis still ['Sleeping'].Expected:
savedStatusOptionsreverts to ['Working'] along with the rest of the version.Where it is
packages/server/src/services/storage/characters.storage.ts:71-90(buildPersonaSnapshot, no savedStatusOptions),100-119(normalizePersonaSnapshot),504-521(updatePersonanextData merge — secondary effect),565-588(restorePersonaVersionset clause).packages/shared/src/types/character.ts:146-163(PersonaCardSnapshot).packages/server/src/db/schema/characters.ts:69(savedStatusOptions: text("saved_status_options").notNull().default("[]")).What's happening
savedStatusOptionswas added as a persona column and handled by create/duplicate/update, but was never added to the version snapshot contract or the restore path, so it's excluded from both capture and restore. The change-detection comparesPersonaCardSnapshotobjects that don't contain the key, so a savedStatusOptions-only edit looks like a no-op.Suggested fix
Make version capture and restore lossless for
savedStatusOptions, and update the CLIENT snapshot builder sopnpm checkstays green:packages/shared/src/types/character.ts— addsavedStatusOptions: string;toPersonaCardSnapshot(aftertags).characters.storage.tsbuildPersonaSnapshot()—savedStatusOptions: persona.savedStatusOptions ?? "[]",.characters.storage.tsnormalizePersonaSnapshot()—savedStatusOptions: data.savedStatusOptions ?? "[]",.characters.storage.tsupdatePersona()nextData merge —...(updates.savedStatusOptions !== undefined && { savedStatusOptions: updates.savedStatusOptions }),(required so a savedStatusOptions-only edit actually produces a snapshot — capturing it in buildPersonaSnapshot is necessary but not sufficient).characters.storage.tsrestorePersonaVersion()set clause —savedStatusOptions: data.savedStatusOptions,(data is normalized, so old snapshots default to "[]").packages/client/src/components/personas/PersonaEditor.tsxbuildCurrentPersonaSnapshot()literal —savedStatusOptions: formData.savedStatusOptions,.Regression note (important):
PersonaCardSnapshotis a SHARED type also built by the client inbuildCurrentPersonaSnapshot(). Adding it as a REQUIRED field WITHOUT step 6 breaks the client typecheck (Property 'savedStatusOptions' is missing), failingpnpm check(the repo's only validation gate).PersonaFormDataalready carriessavedStatusOptions, so the value is available. The?? "[]"defaulting matches the existingtagstreatment and the column default, and restoring old snapshots (no key) is safe becausenormalizePersonaSnapshotdefaults it. Runpnpm checkto confirm both client and server typecheck.AI-investigated against v2.0.6; cited lines read and confirmed. Please verify before fixing.
@SpicyMarinara commented on GitHub (Jun 29, 2026):
Claiming this for the current staging sweep in draft PR #3053 (branch
codex/issue-sweep-3033-3052).@SpicyMarinara commented on GitHub (Jun 29, 2026):
Fixed in PR #3053 on branch
codex/issue-sweep-3033-3052(commitbfb1bc76). Closing this issue as addressed; the PR remains open for staging review/merge.