Skip to content

Commit e5ecfc2

Browse files
authored
Merge pull request #23 from asfires/t3code/invalidate-stale-thread-cache
fix(web): invalidate thread snapshot caches predating migration 044
2 parents def9c8c + 446e616 commit e5ecfc2

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

apps/web/src/connection/storage.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,12 @@ const StoredShellSnapshotJson = Schema.fromJsonString(StoredShellSnapshot);
5858
// v4 invalidates snapshots cached before the wire projection retained tool
5959
// output fields (result/aggregatedOutput); a warm cache resumes via
6060
// `afterSequence` and would otherwise show stripped payloads forever.
61+
// v5 invalidates snapshots cached before server migration 044 deleted
62+
// orphaned retracted messages out-of-band: the deletion emits no events, so
63+
// a warm cache resuming via `afterSequence` would render the ghost messages
64+
// forever. Any server-side row surgery needs a bump here to reach clients.
6165
const StoredThreadSnapshot = Schema.Struct({
62-
schemaVersion: Schema.Literal(4),
66+
schemaVersion: Schema.Literal(5),
6367
environmentId: EnvironmentId,
6468
threadId: ThreadId,
6569
snapshot: OrchestrationThreadDetailSnapshot,
@@ -567,7 +571,7 @@ export const connectionStorageLayer = Layer.effectContext(
567571
saveThread: (environmentId, snapshot) =>
568572
Effect.gen(function* () {
569573
const encoded = yield* encodeStoredThreadSnapshot({
570-
schemaVersion: 4,
574+
schemaVersion: 5,
571575
environmentId,
572576
threadId: snapshot.thread.id,
573577
snapshot,

0 commit comments

Comments
 (0)