-
Notifications
You must be signed in to change notification settings - Fork 176
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
rust-sdk update: Support persisted WedgeQueueError #3724
Conversation
bd5af23
to
3d0ae04
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.
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) }) |
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 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) } |
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.
Not a needed change, but for constructors you can also use .map(::DeviceId)
, which is a bit cleaner.
Depends on matrix-org/matrix-rust-sdk#4137
Update breaking changes
Content
Motivation and context
Screenshots / GIFs
Tests
Tested devices
Checklist