fix(web): invalidate thread snapshot caches predating migration 044 - #23
Merged
Merged
Conversation
Migration 044 deleted orphaned retracted messages directly in sqlite, which emits no orchestration events - warm IndexedDB thread caches resume via afterSequence and would render the deleted ghost messages forever, surviving hard reloads. Bump the stored thread snapshot schema version so pre-044 cache records fail decode and clients refetch clean snapshots. Model: Claude Fable 5 Harness: Claude Code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #22: the migration deletes orphaned retracted messages directly in sqlite, which emits no orchestration events — so warm IndexedDB thread caches (which resume via afterSequence) keep rendering the deleted ghost messages forever, surviving even hard reloads.
Fix follows the cache's established invalidation pattern (see the v2–v4 comment history): bump the stored-record schemaVersion literal so pre-044 records fail decode and clients cold-load clean snapshots. Also documents the rule that any out-of-band row surgery needs a bump here.
Web typecheck clean; storage tests pass. No new unit test for the decode-invalidation path itself — the workspace has no fake-IndexedDB driver and adding one for this is out of scope; the invalidation mechanism is the same one v3 and v4 already rely on.