-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Prompt users to set up recovery #30075
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
Conversation
ee85cf0
to
4f25500
Compare
48aff5f
to
d6995d1
Compare
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.
Looks good from a Crypto point of view.
src/DeviceListener.ts
Outdated
/** | ||
* Account data key to indicate that the user has chosen to disable recovery. | ||
*/ | ||
export const RECOVERY_DISABLED_ACCOUNT_DATA_KEY = "io.element.recovery_disabled"; |
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.
Note that MSC4287 proposes reversing the sense of the BACKUP_DISABLED
boolean, so you might want to follow that pattern here.
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 switched the sense of the boolean. Since it's a non-trivial change, can you give the PR another look?
src/hooks/useEventEmitter.ts
Outdated
* @returns State | ||
*/ | ||
export function useEventEmitterAsyncState<T>( | ||
emitter: EventEmitter | 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.
Can we please avoid untyped EventEmitters? We prefer TypedEventEmitter all over the shop
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.
Looks good, with a quick comment update needed.
// We mark recovery as not disabled, in case it was | ||
// marked as disabled before. | ||
await matrixClient.setAccountData(RECOVERY_DISABLED_ACCOUNT_DATA_KEY, { disabled: false }); | ||
// We mark recovery as not enabled. |
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.
That should be "We mark recovery as enabled" and I would probably rewrite it as "Record the fact that the user explicitly enabled recovery" or similar.
af984c0
Fixes: #29232
Adds an indicator in the user settings dialog when the user doesn't have recovery set up
Update recovery setup toast with new button text, as per design, and remember if the user dismisses it.
It's easiest to review commit-by-commit.