-
Notifications
You must be signed in to change notification settings - Fork 160
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
Require acknowledgement to send to a verified user if their identity changed or if a device is unverified. #3461
Conversation
📱 Scan the QR code below to install the build (arm64 only) for this PR. |
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 code, it works pretty well! I have a few comments, but none are either really important or urgent.
is LocalEventSendState.Failed.VerifiedUserHasUnsignedDevice -> { | ||
val userId = sendState.devices.keys.firstOrNull() | ||
if (userId == null) { | ||
ActionListState.VerifiedUserSendFailure.None |
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.
Is this OK? I guess it shouldn't ever happen except if there is some bug in the SDK, but maybe we should still display the UI with some placeholder value and log the issue?
is LocalEventSendState.Failed.VerifiedUserChangedIdentity -> { | ||
val userId = sendState.users.firstOrNull() | ||
if (userId == null) { | ||
ActionListState.VerifiedUserSendFailure.None |
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.
Same here, whether we decide to treat this as 'the SDK failed to provide some user but the status is right' or 'the status is wrong since there is no user' I think we should at least log these issues.
suspend fun ignoreDeviceTrustAndResend(devices: Map<UserId, List<DeviceId>>, transactionId: TransactionId): Result<Unit> | ||
suspend fun withdrawVerificationAndResend(userIds: List<UserId>, transactionId: TransactionId): Result<Unit> |
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 we add some docs here? I'm not really sure what 'withdraw verification' means in this context.
id = CommonStrings.screen_resolve_send_failure_changed_identity_title, | ||
userDisplayName | ||
) | ||
VerifiedUserSendFailure.None -> "" |
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.
Maybe these should be error("This method should never be called for this state")
? Up to you, it would allow us to catch any regressions faster (and maybe make some users angry 😅 ).
import io.element.android.libraries.matrix.api.timeline.item.event.LocalEventSendState | ||
import timber.log.Timber | ||
|
||
class VerifiedUserSendFailureResolver( |
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.
Some docs, maybe?
Quality Gate passedIssues Measures |
Content
This PR makes the following changes:
Build clients with the requirements to fail when sending to once verified users who aren't (fully) verified any more
Show a description of the send failures for verified users in the ActionListView
Add a bottom sheet to resolve failures for verified users by tapping on the description above, or by tapping on the failure in the timeline.
If there is more than one user ID in the failure, the sheet iterates through them 1 by 1, resolving each one and then dismissing itself at the end.
Motivation and context
Closes #3459
Closes #3460
Screenshots / GIFs
Tests
Tested devices
Checklist