[GH-ISSUE #4869] [Issue]: Preserve Game client state across persistence boundaries #2695

Closed
opened 2026-10-21 05:53:14 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @Xelvanis on GitHub (Aug 10, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/4869

Originally assigned to: @SpicyMarinara on GitHub.

Summary

Several Game client-state values do not survive their real persistence boundaries consistently: Game's Send-on-Enter preference is omitted from cross-device sync, tutorial dismissal is omitted from browser-local persistence, and Session Logs ignore stored token/session metadata when Message.extra arrives as JSON text. The UI store also retains ten obsolete version gates that duplicate unconditional canonicalization.

Expected behavior

  • Game's Send-on-Enter preference follows the user through the existing synchronized UI settings profile.
  • Dismissing the Game tutorial survives an offline or failed-sync restart through browser-local persistence while retaining cross-device sync.
  • Game Session Logs use valid persisted tokenCount values and start at the latest isConversationStart marker whether message metadata arrives as an object or a JSON string.
  • Old and current UI settings continue to pass through the same unconditional canonicalizers without redundant version-gated duplicates.

Actual behavior

  • enterToSendGame is browser-local only and is absent from pickSyncedSettings.
  • gameTutorialDisabled is synchronized but absent from the Zustand persist partialize projection.
  • Game narration reads message.extra as though it were always an object, so the normal persisted JSON-string transport shape loses stored token counts and session-start markers in the visible Session Logs estimate.
  • Ten migration blocks repeat transformations that immediately run unconditionally afterward.

Steps to reproduce

  1. Change Game's Send-on-Enter preference in one browser and load the same server profile in another browser; the Game preference does not follow the profile.
  2. Dismiss the Game tutorial, then restart while server settings sync is unavailable; the browser-local UI blob does not retain the dismissal.
  3. Persist Game messages whose extra contains tokenCount and isConversationStart, then load them through the ordinary API where extra is returned as JSON text.
  4. Open Game Session Logs and observe that the estimate falls back to text sizing and can include messages before the current-session marker.
  5. Inspect the UI-store migration and observe ten version gates that duplicate the unconditional normalization immediately following them.

Environment

  • Marinara Engine version: staging commit c87be14dae617adba9e71adb783752fc81efc254
  • Install type: source
  • OS + version: Windows 11
  • Browser or app shell: Microsoft Edge through the repository's isolated local browser-proof harness

Logs, screenshots, or video

A disposable seeded Game session reproduced the transport shape and verified the corrected visible result on desktop and a 390×844 mobile viewport. With a 999-token message before the latest start marker and persisted current-session counts of 40, 80, and 120, Session Logs correctly displayed ~240 tokens after the fix.

Additional context

Suggested bounded scope:

  • reuse the existing parseMessageExtraRecord helper;
  • add enterToSendGame to the synchronized projection;
  • add gameTutorialDisabled to browser-local persistence while retaining sync;
  • remove only the ten migration gates duplicated by unconditional canonicalizers, retaining genuine version-specific fallbacks;
  • add regressions for object/JSON-string Game metadata, latest session markers, malformed fallback, old/current migration equivalence, and the synced-settings/local-persistence projection invariant.

This affects UI preferences and a displayed estimate only. It does not alter server prompt context, generation, chats, messages, characters, Personas, or lorebooks.

Template check

Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.
Originally created by @Xelvanis on GitHub (Aug 10, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/4869 Originally assigned to: @SpicyMarinara on GitHub. <!-- task-id: client-persisted-state-compatibility --> ## Summary Several Game client-state values do not survive their real persistence boundaries consistently: Game's Send-on-Enter preference is omitted from cross-device sync, tutorial dismissal is omitted from browser-local persistence, and Session Logs ignore stored token/session metadata when `Message.extra` arrives as JSON text. The UI store also retains ten obsolete version gates that duplicate unconditional canonicalization. ## Expected behavior - Game's Send-on-Enter preference follows the user through the existing synchronized UI settings profile. - Dismissing the Game tutorial survives an offline or failed-sync restart through browser-local persistence while retaining cross-device sync. - Game Session Logs use valid persisted `tokenCount` values and start at the latest `isConversationStart` marker whether message metadata arrives as an object or a JSON string. - Old and current UI settings continue to pass through the same unconditional canonicalizers without redundant version-gated duplicates. ## Actual behavior - `enterToSendGame` is browser-local only and is absent from `pickSyncedSettings`. - `gameTutorialDisabled` is synchronized but absent from the Zustand persist `partialize` projection. - Game narration reads `message.extra` as though it were always an object, so the normal persisted JSON-string transport shape loses stored token counts and session-start markers in the visible Session Logs estimate. - Ten migration blocks repeat transformations that immediately run unconditionally afterward. ## Steps to reproduce 1. Change Game's Send-on-Enter preference in one browser and load the same server profile in another browser; the Game preference does not follow the profile. 2. Dismiss the Game tutorial, then restart while server settings sync is unavailable; the browser-local UI blob does not retain the dismissal. 3. Persist Game messages whose `extra` contains `tokenCount` and `isConversationStart`, then load them through the ordinary API where `extra` is returned as JSON text. 4. Open Game **Session Logs** and observe that the estimate falls back to text sizing and can include messages before the current-session marker. 5. Inspect the UI-store migration and observe ten version gates that duplicate the unconditional normalization immediately following them. ## Environment - Marinara Engine version: `staging` commit `c87be14dae617adba9e71adb783752fc81efc254` - Install type: source - OS + version: Windows 11 - Browser or app shell: Microsoft Edge through the repository's isolated local browser-proof harness ## Logs, screenshots, or video A disposable seeded Game session reproduced the transport shape and verified the corrected visible result on desktop and a 390×844 mobile viewport. With a 999-token message before the latest start marker and persisted current-session counts of 40, 80, and 120, Session Logs correctly displayed `~240 tokens` after the fix. ## Additional context Suggested bounded scope: - reuse the existing `parseMessageExtraRecord` helper; - add `enterToSendGame` to the synchronized projection; - add `gameTutorialDisabled` to browser-local persistence while retaining sync; - remove only the ten migration gates duplicated by unconditional canonicalizers, retaining genuine version-specific fallbacks; - add regressions for object/JSON-string Game metadata, latest session markers, malformed fallback, old/current migration equivalence, and the synced-settings/local-persistence projection invariant. This affects UI preferences and a displayed estimate only. It does not alter server prompt context, generation, chats, messages, characters, Personas, or lorebooks. ## Template check Please **uncheck (untick)** the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-21 05:53:14 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#2695
No description provided.