Skip to content

Commit 6d562ef

Browse files
jmartinesppoljar
authored andcommitted
fix: Restore the previous behaviour for calculating the timeout for syncs
1 parent af2e15e commit 6d562ef

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

crates/matrix-sdk/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,13 @@ All notable changes to this project will be documented in this file.
3131
- [**breaking**] The MSRV has been bumped to Rust 1.88.
3232
([#5431](https://github.com/matrix-org/matrix-rust-sdk/pull/5431))
3333

34+
### Bugfix
35+
36+
- All HTTP requests now have a default `read_timeout` of 60s, which means they'll disconnect if the connection stalls.
37+
`RequestConfig::timeout` is now optional and can be disabled on a per-request basis. This will be done for
38+
the requests used to download media, so they don't get cancelled after the default 30s timeout for no good reason.
39+
([#5437](https://github.com/matrix-org/matrix-rust-sdk/pull/5437))
40+
3441
## [0.13.0] - 2025-07-10
3542

3643
### Security Fixes

crates/matrix-sdk/src/client/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ use std::{
2020
future::{ready, Future},
2121
pin::Pin,
2222
sync::{Arc, Mutex as StdMutex, RwLock as StdRwLock, Weak},
23+
time::Duration,
2324
};
2425

2526
use caches::ClientCaches;
@@ -2312,7 +2313,8 @@ impl Client {
23122313
});
23132314
let mut request_config = self.request_config();
23142315
if let Some(timeout) = sync_settings.timeout {
2315-
request_config.timeout = Some(timeout);
2316+
let base_timeout = request_config.timeout.unwrap_or(Duration::from_secs(30));
2317+
request_config.timeout = Some(base_timeout + timeout);
23162318
}
23172319

23182320
let response = self.send(request).with_request_config(request_config).await?;

0 commit comments

Comments
 (0)