Skip to content

Commit

Permalink
feat(notification client): bump sliding sync timeouts (#2403)
Browse files Browse the repository at this point in the history
The timeouts were a bit too agressive, according to some user logs, resulting in failing to
load the event mentioned in the notification.

Here's the rationale for the new timeouts: we're only limited by the iOS process which has *at
most* 30 seconds to process a notification.

- We're running at most 3 requests of the notification sliding sync, so that will be (1+3)*3 = 12
seconds allocated for that.
- If we've found an event but it required decryption, we're running the encryption sync up to
2 times, (3+4) seconds each => 14 seconds.

At most we're eating up 26 seconds of the entire time, leaving some ballast for the rest of
the program.
  • Loading branch information
bnjbvr authored Aug 10, 2023
1 parent e9d6a9b commit 159786f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/matrix-sdk-ui/src/notification_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ impl NotificationClient {
let encryption_sync = EncryptionSync::new(
Self::LOCK_ID.to_owned(),
self.client.clone(),
Some((Duration::from_secs(3), Duration::from_secs(1))),
Some((Duration::from_secs(3), Duration::from_secs(4))),
with_locking,
)
.await;
Expand Down Expand Up @@ -268,7 +268,7 @@ impl NotificationClient {
.client
.sliding_sync(Self::CONNECTION_ID)?
.poll_timeout(Duration::from_secs(1))
.network_timeout(Duration::from_secs(1))
.network_timeout(Duration::from_secs(3))
.with_account_data_extension(
assign!(AccountDataConfig::default(), { enabled: Some(true) }),
)
Expand Down

0 comments on commit 159786f

Please sign in to comment.