fix: don't persist checkpointDiffLoaded flag that prevents diff re-fetching after restart

The checkpointDiffLoaded flag was persisted but the actual diff content
(unifiedDiff, per-file diff) was intentionally stripped during persistence.
After restart and rehydration, summaries appeared as 'already loaded' so
the checkpointDiffHydrationTargets memo in ChatView excluded them, and no
background diff re-fetch was triggered.

Fix: Remove checkpointDiffLoaded from both hydrateThread (handles existing
stored data) and toPersistedState (prevents storing it going forward).
On rehydration the flag will be undefined/falsy, allowing the hydration
logic to correctly re-fetch diffs when a session becomes available.
This commit is contained in:
Cursor Agent committed 2026-02-18 20:33:09 +00:00
1 parent 832eb42ad6
commit b0f138e526
1 file changed
-2
-2
View File
@@ -305,7 +305,6 @@ function hydrateThread(
...(typeof summary.checkpointTurnCount === "number"
? { checkpointTurnCount: summary.checkpointTurnCount }
: {}),
...(summary.checkpointDiffLoaded ? { checkpointDiffLoaded: true } : {}),
})),
};
}
@@ -401,7 +400,6 @@ export function toPersistedState(
...(typeof summary.checkpointTurnCount === "number"
? { checkpointTurnCount: summary.checkpointTurnCount }
: {}),
...(summary.checkpointDiffLoaded ? { checkpointDiffLoaded: true } : {}),
})),
})),
activeThreadId: state.activeThreadId,