Conversation
…rite Bad messages persisted in delegate storage survive across sessions. The previous fix only ran remove_unverifiable_messages when StaleKeyOverwritten was returned, but once the key is fixed, subsequent startups return AlreadyCurrent and skip sanitization — leaving the bad messages to block UPDATEs indefinitely. Now sanitize on every successful migration regardless of result. This is a one-time per-room cost at startup (iterate messages, verify signatures). Only triggers mark_needs_sync if messages were actually removed. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Problem
Follow-up to #170. Bad messages persisted in delegate storage survive across sessions. Once PR #169 fixed the stale key, subsequent startups return
AlreadyCurrentfrommigrate_signing_key(), so the sanitization from #170 (gated onStaleKeyOverwritten) never runs. The bad messages keep blocking UPDATEs.Approach
Run
remove_unverifiable_messages()on every successful migration, not justStaleKeyOverwritten. This is a one-time per-room cost at startup. Only callsmark_needs_syncif messages were actually removed, avoiding unnecessary sync cycles.UI-only change, no WASM migration needed.
[AI-assisted - Claude]