feat: add schema version system with outdated save detection

Introduces a schema version field to GameState. Saves without the
current schema version are flagged on load (showing a modal prompting
reset or proceed), and cloud saves from outdated clients are rejected
server-side. Removes all backfill code now that outdated saves are
handled via the reset flow instead.

New POST /game/reset endpoint creates a fresh save for players who
choose to reset. Save version and current schema version are displayed
in the sidebar below the app version.
This commit is contained in:
2026-03-07 17:34:26 -08:00
committed by Naomi Carrigan
parent 4ed3ccc69c
commit 5d2d71983a
11 changed files with 205 additions and 276 deletions
+4
View File
@@ -48,6 +48,10 @@ export interface LoadResponse {
loginBonus: LoginBonusResult | null;
/** Current login streak (always present) */
loginStreak: number;
/** True when the player's save data is from an older schema version */
schemaOutdated: boolean;
/** The current expected schema version from the server */
currentSchemaVersion: number;
}
export interface BossChallengeRequest {
@@ -49,4 +49,6 @@ export interface GameState {
companions?: CompanionState;
/** Story chapter unlock and completion state — optional for backwards compatibility */
story?: StoryState;
/** Schema version — used to detect saves from older game versions */
schemaVersion?: number;
}