-
Notifications
You must be signed in to change notification settings - Fork 171
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
Feature: identity reset #3298
Feature: identity reset #3298
Conversation
📱 Scan the QR code below to install the build (arm64 only) for this PR. |
de7f819
to
d5eb71a
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.
A few first remarks.
I have tested the reset using password, it's working as expected.
Also tested using Oidc, working as expected.
} else if (state.resetAction.isFailure()) { | ||
ErrorDialog( | ||
content = stringResource(CommonStrings.error_unknown), | ||
onDismiss = { state.eventSink(ResetIdentityPasswordEvent.DismissError) } |
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.
modifier = Modifier.fillMaxWidth(), | ||
text = stringResource(CommonStrings.action_reset_identity), | ||
onClick = { state.eventSink(ResetIdentityPasswordEvent.Reset(passwordState.value)) }, | ||
destructive = 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.
}, | ||
destructiveSubmit = true, | ||
onDismiss = { state.eventSink(ResetIdentityRootEvent.DismissDialog) } | ||
) |
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 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 latest agreed terminology is "Reset identity". See https://github.com/matrix-org/matrix-spec-proposals/blob/andybalaam/crypto-terminology/proposals/4161-crypto-terminology.md#identity as well as the Figma designs. The MAS screen will be updated with the next release.
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.
FWIW, your first screen is outdated. Figma designs have been updated since.
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.
You mean this one?
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 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 have requested to access the Figma file (again)
lifecycle.addObserver(object : DefaultLifecycleObserver { | ||
override fun onStart(owner: LifecycleOwner) { | ||
// If the custom tab was opened, we need to cancel the reset job | ||
// when we come back to the node if it the reset wasn't successful |
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.
// when we come back to the node if it the reset wasn't successful | |
// when we come back to the node if the reset wasn't successful |
val handle = resetIdentityFlowManager.getResetHandle() | ||
.filterIsInstance<AsyncData.Success<IdentityResetHandle>>() | ||
.first() | ||
.data |
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.
This will ignore any Failure coming in the flow. Can it be a problem?
Maybe add a log, just in case...
libraries/oidc/api/build.gradle.kts
Outdated
@@ -0,0 +1,27 @@ | |||
/* | |||
* Copyright (c) 2023 New Vector Ltd |
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.
* Copyright (c) 2023 New Vector Ltd | |
* Copyright (c) 2024 New Vector Ltd |
libraries/oidc/impl/build.gradle.kts
Outdated
@@ -0,0 +1,71 @@ | |||
/* | |||
* Copyright (c) 2022 New Vector Ltd |
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.
* Copyright (c) 2022 New Vector Ltd | |
* Copyright (c) 2024 New Vector Ltd |
libraries/oidc/impl/build.gradle.kts
Outdated
testImplementation(projects.libraries.matrix.test) | ||
testImplementation(projects.libraries.permissions.test) | ||
testImplementation(projects.tests.testutils) | ||
testReleaseImplementation(libs.androidx.compose.ui.test.manifest) |
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 some unused dependencies can be removed 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.
Wording: reset encryption
or reset identity
?
val currentHandleFlow: StateFlow<AsyncData<IdentityResetHandle>> = resetHandleFlow | ||
|
||
fun whenResetIsDone(block: () -> Unit) { | ||
sessionCoroutineScope.launch { |
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 cancel this job if the user click go back instead of going to the end of the flow (or use the presenter / node scope)
Quality Gate passedIssues Measures |
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.
Thanks for the update!
Content
libraries/oidc
.OidcEntryPoint
which allows opening any of the OIDC flow options (custom tab, webview).IdentityResetHandle
wrappers for both OIDC and password variants.Motivation and context
Closes #3268.
Screenshots / GIFs
In the PR.
Tests
With a user + password based account whose data you don't mind losing:
With an OIDC one (maybe using
synapse-oidc.element.dev
?):Tested devices
Checklist