mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-05-09 08:27:32 -04:00
fix: Restore the previous behaviour for calculating the timeout for syncs
This commit is contained in:
committed by
Damir Jelić
parent
af2e15e02f
commit
6d562eff2f
@@ -31,6 +31,13 @@ All notable changes to this project will be documented in this file.
|
||||
- [**breaking**] The MSRV has been bumped to Rust 1.88.
|
||||
([#5431](https://github.com/matrix-org/matrix-rust-sdk/pull/5431))
|
||||
|
||||
### Bugfix
|
||||
|
||||
- All HTTP requests now have a default `read_timeout` of 60s, which means they'll disconnect if the connection stalls.
|
||||
`RequestConfig::timeout` is now optional and can be disabled on a per-request basis. This will be done for
|
||||
the requests used to download media, so they don't get cancelled after the default 30s timeout for no good reason.
|
||||
([#5437](https://github.com/matrix-org/matrix-rust-sdk/pull/5437))
|
||||
|
||||
## [0.13.0] - 2025-07-10
|
||||
|
||||
### Security Fixes
|
||||
|
||||
@@ -20,6 +20,7 @@ use std::{
|
||||
future::{ready, Future},
|
||||
pin::Pin,
|
||||
sync::{Arc, Mutex as StdMutex, RwLock as StdRwLock, Weak},
|
||||
time::Duration,
|
||||
};
|
||||
|
||||
use caches::ClientCaches;
|
||||
@@ -2312,7 +2313,8 @@ impl Client {
|
||||
});
|
||||
let mut request_config = self.request_config();
|
||||
if let Some(timeout) = sync_settings.timeout {
|
||||
request_config.timeout = Some(timeout);
|
||||
let base_timeout = request_config.timeout.unwrap_or(Duration::from_secs(30));
|
||||
request_config.timeout = Some(base_timeout + timeout);
|
||||
}
|
||||
|
||||
let response = self.send(request).with_request_config(request_config).await?;
|
||||
|
||||
Reference in New Issue
Block a user