[GH-ISSUE #1239] [Issue]: Refactor startup rejects snapshot personaStats arrays #607

Closed
opened 2026-10-20 17:30:40 +07:00 by bsakaguchi · 1 comment
Owner

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

Originally assigned to: @Xelvanis on GitHub.

Summary

Existing refactor save data can store game-state-snapshots.personaStats as an array, but startup JSON-field migration treated it as an object/null field. On launch, affected save data can fail initialization with invalid_input: personaStats must be a JSON object or null.

Expected behavior

Tauri desktop startup should accept snapshot personaStats arrays and preserve valid tracker snapshot data.

Actual behavior

Startup migration can reject rows where game-state-snapshots.personaStats is an array, preventing the app from opening existing save data.

Steps to reproduce

  1. Start from refactor save data containing a game-state-snapshots row whose personaStats field is a JSON array.
  2. Launch the Tauri desktop app.
  3. Observe startup failing during storage JSON-field migration with a personaStats shape error.

Impact area

  • App shell, navigation, startup, or providers
  • Catalog resources
  • Chat mode
  • Roleplay mode
  • Game mode
  • Shared mode UI
  • Runtime systems: generation, world-state, visuals, tracker, or haptics
  • Professor Mari or shell tools
  • React-free engine behavior, contracts, agents, or capability ports
  • Shared API wrapper or remote runtime routing
  • Tauri/Rust storage, assets, LLM, integrations, security, imports, or HTTP runtime
  • Docs, contributor workflow, or templates

Environment

  • Branch or commit: refactor
  • Run mode: Tauri desktop
  • OS + version: Windows, exact version not collected
  • Node + pnpm versions: not relevant to root cause
  • Rust version, if relevant: not collected
  • Remote Runtime URL configured? not relevant
  • Provider, model, or integration, if relevant: not relevant

Logs, screenshots, or video

Observed local startup error:

invalid_input: personaStats must be a JSON object or null

Regression notes

This is a refactor storage migration/data-shape mismatch. Tracker snapshot readers and writers use array/null semantics for personaStats, but startup migration was normalizing the field as object/null.

Additional context

A fix branch adds migration coverage for array/null snapshot personaStats and a startup repair path for malformed old snapshot rows so one damaged row does not abort initialization.

Template check

Please uncheck 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 (May 26, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1239 Originally assigned to: @Xelvanis on GitHub. ## Summary Existing refactor save data can store `game-state-snapshots.personaStats` as an array, but startup JSON-field migration treated it as an object/null field. On launch, affected save data can fail initialization with `invalid_input: personaStats must be a JSON object or null`. ## Expected behavior Tauri desktop startup should accept snapshot `personaStats` arrays and preserve valid tracker snapshot data. ## Actual behavior Startup migration can reject rows where `game-state-snapshots.personaStats` is an array, preventing the app from opening existing save data. ## Steps to reproduce 1. Start from refactor save data containing a `game-state-snapshots` row whose `personaStats` field is a JSON array. 2. Launch the Tauri desktop app. 3. Observe startup failing during storage JSON-field migration with a `personaStats` shape error. ## Impact area - [x] App shell, navigation, startup, or providers - [ ] Catalog resources - [ ] Chat mode - [x] Roleplay mode - [x] Game mode - [ ] Shared mode UI - [x] Runtime systems: generation, world-state, visuals, tracker, or haptics - [ ] Professor Mari or shell tools - [ ] React-free engine behavior, contracts, agents, or capability ports - [ ] Shared API wrapper or remote runtime routing - [x] Tauri/Rust storage, assets, LLM, integrations, security, imports, or HTTP runtime - [ ] Docs, contributor workflow, or templates ## Environment - Branch or commit: `refactor` - Run mode: Tauri desktop - OS + version: Windows, exact version not collected - Node + pnpm versions: not relevant to root cause - Rust version, if relevant: not collected - Remote Runtime URL configured? not relevant - Provider, model, or integration, if relevant: not relevant ## Logs, screenshots, or video Observed local startup error: ```text invalid_input: personaStats must be a JSON object or null ``` ## Regression notes This is a refactor storage migration/data-shape mismatch. Tracker snapshot readers and writers use array/null semantics for `personaStats`, but startup migration was normalizing the field as object/null. ## Additional context A fix branch adds migration coverage for array/null snapshot `personaStats` and a startup repair path for malformed old snapshot rows so one damaged row does not abort initialization. ## Template check Please uncheck 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-20 17:30:40 +07:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@Xelvanis commented on GitHub (May 26, 2026):

Fix PR opened: #1240

<!-- gh-comment-id:4539765714 --> @Xelvanis commented on GitHub (May 26, 2026): Fix PR opened: #1240
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#607
No description provided.