-
-
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 #29113
base: develop
Are you sure you want to change the base?
Conversation
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.
The last missing part of this new tab! Few questions and remarks
Icon={ErrorIcon} | ||
destructive={true} | ||
title={_t("settings|encryption|delete_key_storage|title")} | ||
className="mx_ResetIdentityPanel" |
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 think we need to rename the CSS class to something more generic. I'm not expecting the mx_ResetIdentityPanel
class in the _ResetIdentityPanel.css
to have an impact in another component
if (keyBackupIsEnabled === undefined) { | ||
content = <Spinner />; | ||
} else { | ||
switch (state) { | ||
case "loading": | ||
content = <InlineSpinner aria-label={_t("common|loading")} />; | ||
break; |
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 looks like we have two loading state, I'll be happy if we can keep one loading state
setupNewKey ? setState("set_recovery_key") : setState("change_recovery_key") | ||
} | ||
if (keyBackupIsEnabled === undefined) { | ||
content = <Spinner />; |
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.
content = <Spinner />; | |
content = <InlineSpinner aria-label={_t("common|loading")} />; |
@@ -45,7 +51,8 @@ export type State = | |||
| "set_recovery_key" | |||
| "reset_identity_compromised" | |||
| "reset_identity_forgot" | |||
| "secrets_not_cached"; | |||
| "secrets_not_cached" | |||
| "key_storage_delete"; |
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.
Missing doc :)
import { useKeyStoragePanelViewModel } from "../../../viewmodels/settings/encryption/KeyStoragePanelViewModel"; | ||
|
||
interface Props { | ||
onKeyStorageDisableClick: () => void; |
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.
Missing tsdoc
// 'null' means no backup is active. 'undefined' means we're still loading. | ||
isEnabled: boolean | undefined; | ||
setEnabled: (enable: boolean) => void; | ||
loading: boolean; // true if the state is still loading for the first time | ||
busy: boolean; // true if the status is in the process of being changed |
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.
All this attributes needs tsdoc and not only comments
|
||
interface KeyStoragePanelState { | ||
// 'null' means no backup is active. 'undefined' means we're still loading. | ||
isEnabled: boolean | undefined; |
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.
There is no null
value despite the comment
await matrixClient.deleteAccountData("m.megolm_backup.v1"); | ||
|
||
// Delete the key information | ||
const defaultKeyEvent = matrixClient.getAccountData("m.secret_storage.default_key"); |
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.
Genuine question, should we not use matrixClient.secretStorage.getDefaultKeyId()
instead?
@@ -111,4 +111,19 @@ test.describe("Encryption tab", () => { | |||
// The user is prompted to reset their identity | |||
await expect(dialog.getByText("Forgot your recovery key? You’ll need to reset your identity.")).toBeVisible(); | |||
}); | |||
|
|||
test("should warn before turning off key storage", async ({ page, app, util }) => { | |||
await verifySession(app, "new passphrase"); |
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.
FYI, I opened #29214
await expect( | ||
page.getByRole("heading", { name: "Are you sure you want to turn off key storage and delete it?" }), | ||
).toBeVisible(); |
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 think a screenshot can be great here to avoid regression on the "Are you sure you want to turn off key storage and delete it?" panel
Requires matrix-org/matrix-js-sdk#4661
Checklist
public
/exported
symbols have accurate TSDoc documentation.