Offer Retry and Remove actions with a reason when tapping a failed message

Tapping the red (!) on a message that failed to send used to show a bare
"Sending failed" alert with only an OK button. Now the alert includes the
failure reason from the SDK (e.g. the HTTP error that caused it) and offers
Retry sending, Remove message and Cancel actions, wired to the send handle's
resend and to redacting the local echo respectively.
This commit is contained in:
Matthew Hodgson
2026-08-06 18:34:49 +03:00
committed by Stefan Ceriu
parent 033cb2e038
commit 1aa9b29eb5
5 changed files with 35 additions and 9 deletions
@@ -65,7 +65,7 @@ nonisolated enum TimelineItemSendFailure: Hashable {
}
case verifiedUser(VerifiedUser)
case unknown
case unknown(reason: String?)
}
/// A light wrapper around event timeline items returned from Rust.
@@ -95,8 +95,10 @@ final nonisolated class EventTimelineItemProxy: Sendable {
return .sendingFailed(.verifiedUser(.changedIdentity(users: users)))
case .insecureDevices(let userDeviceMap):
return .sendingFailed(.verifiedUser(.hasUnsignedDevice(devices: userDeviceMap)))
case .genericApiError(let message):
return .sendingFailed(.unknown(reason: message))
default:
return .sendingFailed(.unknown)
return .sendingFailed(.unknown(reason: nil))
}
case .notSentYet:
return .sending