-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Add key storage toggle to Encryption settings #29310
base: develop
Are you sure you want to change the base?
Conversation
as apparenty the error icon has changed
Right, I think this is finally ready for another look. |
res/css/components/views/settings/encryption/_KeyStoragePanel.pcss
Outdated
Show resolved
Hide resolved
src/components/views/settings/tabs/user/EncryptionUserSettingsTab.tsx
Outdated
Show resolved
Hide resolved
src/components/views/settings/tabs/user/EncryptionUserSettingsTab.tsx
Outdated
Show resolved
Hide resolved
src/components/views/settings/tabs/user/EncryptionUserSettingsTab.tsx
Outdated
Show resolved
Hide resolved
* we don't so much care about the value of the account data, "m.org.matrix.custom.backup_disabled" | ||
* flag here: what's important is whether key backup is actually happening or not). |
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.
ok, but this does not match what the code is doing. So: what gives?
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.
I've added some more clarification: I couldn't see a better way to do this although happy to change it if you have a suggestion.
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.
my point is: we're not checking whether key backup is actually happening or not. For better or worse, that's not what getKeyBackupInfo
does.
In any case: are you sure that "whether the key backup is actually happening" is the intended design, from product/design folks?
if (currentKeyBackup === null) { | ||
await crypto.resetKeyBackup(); | ||
} |
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.
could you explain why this is necessary, and why only when currentKeyBackup
is null?
// also turn off 4S, since this is also storing keys on the server. | ||
// Delete the cross signing keys from secret storage | ||
await matrixClient.deleteAccountData("m.cross_signing.master"); | ||
await matrixClient.deleteAccountData("m.cross_signing.self_signing"); | ||
await matrixClient.deleteAccountData("m.cross_signing.user_signing"); | ||
// and the key backup key (we just turned it off anyway) | ||
await matrixClient.deleteAccountData("m.megolm_backup.v1"); | ||
|
||
// Delete the key information | ||
const defaultKey = await matrixClient.secretStorage.getDefaultKeyId(); | ||
if (defaultKey) { | ||
await matrixClient.deleteAccountData(`m.secret_storage.key.${defaultKey}`); | ||
|
||
// ...and the default key pointer | ||
await matrixClient.deleteAccountData("m.secret_storage.default_key"); | ||
} | ||
|
||
// finally, set a flag to say that the user doesn't want key backup. | ||
// Element X uses this to determine whether to set up automatically, | ||
// so this will stop EX turning it back on spontaneously. | ||
await matrixClient.setAccountData("m.org.matrix.custom.backup_disabled", { disabled: true }); |
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.
didn't we talk about disabling dehydration, and making this all a method in the js-sdk?
} | ||
|
||
/** | ||
* Confirms that the user really wants to turn off and delete their key storage |
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.
* Confirms that the user really wants to turn off and delete their key storage | |
* Confirms that the user really wants to turn off and delete their key storage. Part of the "Encryption" settings tab. |
@@ -3529,7 +3529,7 @@ | |||
classnames "^2.5.1" | |||
vaul "^1.0.0" | |||
|
|||
"@vector-im/matrix-wysiwyg-wasm@link:../../Library/Caches/Yarn/v6/npm-@vector-im-matrix-wysiwyg-2.38.0-af862ffd231dc0a6b8d6f2cb3601e68456c0ff24-integrity/node_modules/bindings/wysiwyg-wasm": | |||
"@vector-im/matrix-wysiwyg-wasm@link:../../../.cache/yarn/v6/npm-@vector-im-matrix-wysiwyg-2.38.0-af862ffd231dc0a6b8d6f2cb3601e68456c0ff24-integrity/node_modules/bindings/wysiwyg-wasm": |
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.
I don't know if this makes any difference, but it should probably be removed from this PR to reduce the risk of conflicts
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.
I really don't feel like this snapshot should be changing, but I guess it's fine
and also sort out indenting
#29113 minus a couple of things that got split out
Checklist
public
/exported
symbols have accurate TSDoc documentation.