From 50fe9056106b42a093de13a517bd7b929a15cca5 Mon Sep 17 00:00:00 2001 From: Hikari Date: Fri, 6 Mar 2026 19:10:12 -0800 Subject: [PATCH] fix: stamp lastSavedAt into game state blob on save --- apps/api/src/routes/game.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/apps/api/src/routes/game.ts b/apps/api/src/routes/game.ts index 2ed145c..079c73f 100644 --- a/apps/api/src/routes/game.ts +++ b/apps/api/src/routes/game.ts @@ -367,6 +367,13 @@ gameRouter.post("/save", async (context) => { const now = Date.now(); + // Stamp the authoritative save timestamp into the state blob so that on the + // next load the client reads the correct value from state.player.lastSavedAt. + stateToSave = { + ...stateToSave, + player: { ...stateToSave.player, lastSavedAt: now }, + }; + await prisma.player.update({ where: { discordId }, data: {