Skip to content

Reset key storage if restoring from Recovery encounters the wrong decryption key#32668

Merged
andybalaam merged 3 commits intodevelopfrom
andybalaam/fix-backup-when-decryption-key-is-wrong-31793
Mar 5, 2026
Merged

Reset key storage if restoring from Recovery encounters the wrong decryption key#32668
andybalaam merged 3 commits intodevelopfrom
andybalaam/fix-backup-when-decryption-key-is-wrong-31793

Conversation

@andybalaam
Copy link
Copy Markdown
Member

@andybalaam andybalaam commented Feb 27, 2026

Fixes #31793

Depends on matrix-org/matrix-js-sdk#5202

When we try to load the key storage decryption key from Recovery, but we find that it does not match the public key of the current key storage backup, create a new key storage backup. This means the user no longer has a broken backup, so their historical message keys are being backed up.

@andybalaam andybalaam force-pushed the andybalaam/fix-backup-when-decryption-key-is-wrong-31793 branch from 269011a to 5e7ff45 Compare March 2, 2026 14:01
@andybalaam andybalaam force-pushed the andybalaam/fix-backup-when-decryption-key-is-wrong-31793 branch from 5e7ff45 to 30eb97e Compare March 2, 2026 14:59
@andybalaam andybalaam force-pushed the andybalaam/fix-backup-when-decryption-key-is-wrong-31793 branch from 30eb97e to 1045654 Compare March 2, 2026 15:44
@andybalaam andybalaam marked this pull request as ready for review March 2, 2026 15:44
@andybalaam andybalaam requested review from a team as code owners March 2, 2026 15:44
@andybalaam andybalaam requested a review from florianduros March 4, 2026 10:37
Without this, we can't override MatrixClient methods until we've called
`renderComponent`, which is awkward.
It turns out the existing test didn't actually go down the expected code
path and call loadSessionBackupPrivateKeyFromSecretStorage.
…ryption key

Fixes #31793

Depends on matrix-org/matrix-js-sdk#5202

When we try to load the key storage decryption key from Recovery, but we
find that it does not match the public key of the current key storage
backup, create a new key storage backup.
@andybalaam andybalaam force-pushed the andybalaam/fix-backup-when-decryption-key-is-wrong-31793 branch from 1b7bc9b to ae33ec1 Compare March 5, 2026 10:34
@andybalaam andybalaam enabled auto-merge March 5, 2026 10:34
@andybalaam andybalaam added this pull request to the merge queue Mar 5, 2026
Merged via the queue into develop with commit 1c2441b Mar 5, 2026
41 of 42 checks passed
@andybalaam andybalaam deleted the andybalaam/fix-backup-when-decryption-key-is-wrong-31793 branch March 5, 2026 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Key storage out of sync: after entering recovery key, it tries to create a new recovery key

3 participants