-
-
Notifications
You must be signed in to change notification settings - Fork 606
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
Rust crypto: ensure we persist the key backup version #3770
Conversation
src/rust-crypto/rust-crypto.ts
Outdated
const base64Key = encodeBase64(key); | ||
|
||
// TODO get version from backupManager | ||
await this.olmMachine.saveBackupDecryptionKey(RustSdkCryptoJs.BackupDecryptionKey.fromBase64(base64Key), ""); | ||
const activeVersion = version ?? (await this.backupManager.requestKeyBackupVersion())?.version; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be good to avoid the call to requestKeyBackupVersion
. Can we just make version
mandatory? AFAICT the caller should always have it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I was a bit hesitant, wasn't it part of API? Mainly why I kept the existing one as deprecated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to keep the old one working for old crypto. It doesn't mean we have to keep the old one working with rust crypto provided the new one works with the react-sdk.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm otherwise, thanks!
Fixes element-hq/element-web#26259
Checklist
This change is marked as an internal change (Task), so will not be included in the changelog.