diff --git a/crates/matrix-sdk/src/error.rs b/crates/matrix-sdk/src/error.rs index 0e1041a5066..f27e11df8f6 100644 --- a/crates/matrix-sdk/src/error.rs +++ b/crates/matrix-sdk/src/error.rs @@ -320,8 +320,9 @@ pub enum Error { #[error("a concurrent request failed; see logs for details")] ConcurrentRequestFailed, - /// An other error was raised - /// this might happen because encryption was enabled on the base-crate + /// An other error was raised. + /// + /// This might happen because encryption was enabled on the base-crate /// but not here and that raised. #[error("unknown error: {0}")] UnknownError(Box), diff --git a/crates/matrix-sdk/src/send_queue.rs b/crates/matrix-sdk/src/send_queue.rs index bf616844185..3a60952e79c 100644 --- a/crates/matrix-sdk/src/send_queue.rs +++ b/crates/matrix-sdk/src/send_queue.rs @@ -471,11 +471,20 @@ impl RoomSendQueue { } Err(err) => { - let is_recoverable = if let crate::Error::Http(ref http_err) = err { - // All transient errors are recoverable. - matches!(http_err.retry_kind(), RetryKind::Transient { .. }) - } else { - false + let is_recoverable = match err { + crate::Error::Http(ref http_err) => { + // All transient errors are recoverable. + matches!(http_err.retry_kind(), RetryKind::Transient { .. }) + } + + // `ConcurrentRequestFailed` typically happens because of an HTTP failure; + // since we don't get the underlying error, be lax and consider it + // recoverable, and let observers decide to retry it or not. At some point + // we'll get the actual underlying error. + crate::Error::ConcurrentRequestFailed => true, + + // As of 2024-06-27, all other error types are considered unrecoverable. + _ => false, }; if is_recoverable {