Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ElementR | Element R doesn't warn the user when the key backup has been deleted or reset from another session #26792

Open
BillCarsonFr opened this issue Dec 20, 2023 · 3 comments · May be fixed by matrix-org/matrix-react-sdk#12160
Labels
A-Element-R Issues affecting the port of Element's crypto layer to Rust O-Occasional Affects or can be seen by some users regularly or most users rarely S-Major Severely degrades major functionality or product features, with no satisfactory workaround T-Defect Z-Labs

Comments

@BillCarsonFr
Copy link
Member

BillCarsonFr commented Dec 20, 2023

The code is on MatrixChat.tsx in react sdk

 cli.on(CryptoEvent.KeyBackupFailed, async (errcode): Promise<void> => {
            let haveNewVersion: boolean | undefined;
            let newVersionInfo: IKeyBackupInfo | null = null;
            // if key backup is still enabled, there must be a new backup in place
            if (cli.getKeyBackupEnabled()) {
                haveNewVersion = true;

stack trace:

client.ts:3423 Uncaught (in promise) Error: End-to-end encryption disabled
    at MatrixClient.getKeyBackupEnabled (client.ts:3423:19)
    at MatrixClient.<anonymous> (MatrixChat.tsx:1677:21)
    at MatrixClient.emit (events.js:153:1)
    at MatrixClient.emit (typed-event-emitter.ts:89:22)
    at RustCrypto.forSource (ReEmitter.ts:55:29)
    at RustCrypto.emit (events.js:153:1)

Step to reproduce

  • Register on web and setup recovery
  • Send a few message from that session
  • Login on another session
  • From the other session, reset the backup
  • From the first session, type /discardsession then type a new message to trigger a key upload

Expected

Should show this popup
image

Actual

Nothing happens

@BillCarsonFr BillCarsonFr added the A-Element-R Issues affecting the port of Element's crypto layer to Rust label Dec 20, 2023
@MidhunSureshR MidhunSureshR added S-Major Severely degrades major functionality or product features, with no satisfactory workaround O-Occasional Affects or can be seen by some users regularly or most users rarely T-Defect labels Dec 21, 2023
@richvdh
Copy link
Member

richvdh commented Jan 15, 2024

@BillCarsonFr when is this codepath reached?

@BillCarsonFr
Copy link
Member Author

@BillCarsonFr when is this codepath reached?

It's emitted in the key backup upload loop, in case of M_WRONG_ROOM_KEYS_VERSION errors for example.

https://github.com/matrix-org/matrix-js-sdk/blob/2ef3ebb466ece630eba88ef29565d71a88efca08/src/rust-crypto/backup.ts#L371

@BillCarsonFr BillCarsonFr self-assigned this Jan 19, 2024
@BillCarsonFr BillCarsonFr changed the title ElementR | React sdk calling deprecated getKeyBackupEnabled that fails on rust stack ElementR | Element R doesn't warn the user when the key backup has been delete or reset from another session Jan 19, 2024
@BillCarsonFr BillCarsonFr changed the title ElementR | Element R doesn't warn the user when the key backup has been delete or reset from another session ElementR | Element R doesn't warn the user when the key backup has been deleted or reset from another session Jan 19, 2024
@BillCarsonFr
Copy link
Member Author

Should make it consistent with element-x behavior (Please Confirm your recovery Key) when your local secrets are out of date.
https://github.com/element-hq/element-meta/blob/develop/docs/crypto/backup.md#recovery-settings

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Element-R Issues affecting the port of Element's crypto layer to Rust O-Occasional Affects or can be seen by some users regularly or most users rarely S-Major Severely degrades major functionality or product features, with no satisfactory workaround T-Defect Z-Labs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants