Skip to content
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

rust-sdk update: Support persisted WedgeQueueError #3724

Conversation

BillCarsonFr
Copy link
Member

Depends on matrix-org/matrix-rust-sdk#4137
Update breaking changes

Content

Motivation and context

Screenshots / GIFs

Tests

  • Step 1
  • Step 2
  • Step ...

Tested devices

  • Physical
  • Emulator
  • OS version(s):

Checklist

  • Changes have been tested on an Android device or Android emulator with API 23
  • UI change has been tested on both light and dark themes
  • Accessibility has been taken into account. See https://github.com/element-hq/element-x-android/blob/develop/CONTRIBUTING.md#accessibility
  • Pull request is based on the develop branch
  • Pull request title will be used in the release note, it clearly define what will change for the user
  • Pull request includes screenshots or videos if containing UI changes
  • Pull request includes a sign off
  • You've made a self review of your PR

@BillCarsonFr BillCarsonFr requested a review from a team as a code owner October 23, 2024 13:13
@BillCarsonFr BillCarsonFr requested review from ganfra and removed request for a team October 23, 2024 13:13
@ElementBot
Copy link
Collaborator

ElementBot commented Oct 23, 2024

Messages
📖 Sign-off not required, allow-list

Generated by 🚫 dangerJS against 3d0ae04

@BillCarsonFr BillCarsonFr added the PR-Bugfix For bug fix label Oct 23, 2024
@BillCarsonFr BillCarsonFr force-pushed the feature/valere/update_send_queue_changes branch from bd5af23 to 3d0ae04 Compare October 24, 2024 08:52
@BillCarsonFr BillCarsonFr changed the base branch from develop to feature/valere/bump_rust_sdk_0.2.57 October 24, 2024 08:53
Copy link
Member

@jmartinesp jmartinesp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, 2 suggestions but it's fine to also merge it as is.

}
is QueueWedgeError.IdentityViolations -> {
// smart cast impossible because 'error' is a public API property declared in different module
LocalEventSendState.Failed.VerifiedUserChangedIdentity((error as QueueWedgeError.IdentityViolations).users.map { UserId(it) })
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A way to avoid this seems to be using:

is RustEventSendState.SendingFailed -> error.run {
    when (this) {
        ...
        is QueueWedgeError.IdentityViolations -> {
            // smart cast impossible because 'error' is a public API property declared in different module
            LocalEventSendState.Failed.VerifiedUserChangedIdentity(this.users.map { UserId(it) })
        }

But I'm not sure if it's worth it.

LocalEventSendState.Failed.VerifiedUserHasUnsignedDevice(
// smart cast impossible because 'error' is a public API property declared in different module
devices = (error as QueueWedgeError.InsecureDevices).userDeviceMap.entries.associate { entry ->
UserId(entry.key) to entry.value.map { DeviceId(it) }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a needed change, but for constructors you can also use .map(::DeviceId), which is a bit cleaner.

@jmartinesp jmartinesp removed the request for review from ganfra October 24, 2024 09:37
@BillCarsonFr BillCarsonFr merged this pull request into feature/valere/bump_rust_sdk_0.2.57 Oct 24, 2024
13 of 23 checks passed
@BillCarsonFr BillCarsonFr deleted the feature/valere/update_send_queue_changes branch October 24, 2024 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR-Bugfix For bug fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants