Skip to content

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

Merged
merged 8 commits into from
Jun 18, 2025

Conversation

uhoreg
Copy link
Member

@uhoreg uhoreg commented Jun 3, 2025

Fixes: #29232

Adds an indicator in the user settings dialog when the user doesn't have recovery set up

image

Update recovery setup toast with new button text, as per design, and remember if the user dismisses it.

image

It's easiest to review commit-by-commit.

Copy link
Member

@andybalaam andybalaam left a 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.

/**
* Account data key to indicate that the user has chosen to disable recovery.
*/
export const RECOVERY_DISABLED_ACCOUNT_DATA_KEY = "io.element.recovery_disabled";
Copy link
Member

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.

Copy link
Member Author

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?

* @returns State
*/
export function useEventEmitterAsyncState<T>(
emitter: EventEmitter | undefined,
Copy link
Member

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

Copy link
Member

@andybalaam andybalaam left a 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.
Copy link
Member

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.

@uhoreg uhoreg added this pull request to the merge queue Jun 18, 2025
Merged via the queue into element-hq:develop with commit af984c0 Jun 18, 2025
37 of 39 checks passed
@uhoreg uhoreg deleted the prompt_set_up_recovery branch June 18, 2025 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

EW: Prompt users to set up recovery (on a verified device)
3 participants