Skip to content

fix: always sanitize messages on startup#171

Merged
sanity merged 1 commit intomainfrom
fix-always-sanitize
Mar 13, 2026
Merged

fix: always sanitize messages on startup#171
sanity merged 1 commit intomainfrom
fix-always-sanitize

Conversation

@sanity
Copy link
Contributor

@sanity sanity commented Mar 13, 2026

Problem

Follow-up to #170. Bad messages persisted in delegate storage survive across sessions. Once PR #169 fixed the stale key, subsequent startups return AlreadyCurrent from migrate_signing_key(), so the sanitization from #170 (gated on StaleKeyOverwritten) never runs. The bad messages keep blocking UPDATEs.

Approach

Run remove_unverifiable_messages() on every successful migration, not just StaleKeyOverwritten. This is a one-time per-room cost at startup. Only calls mark_needs_sync if messages were actually removed, avoiding unnecessary sync cycles.

UI-only change, no WASM migration needed.

[AI-assisted - Claude]

…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>
@sanity sanity merged commit 8b4da2d into main Mar 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant