atagen

matrix-rust-sdk

public
Star0
Watch0

Commit d56592fb23bd

tarball

atagen <boss@atagen.co>2026-10-26 10:45 UTC

1 file changed+9-4
timeline: keep retrying a lagged live timeline's snapshot instead of stopping

After a Lagged, the update task re-subscribed with subscribe_with_history and broke out of its loop if that store read failed. The Timeline then lived on with only its local echo listener: own sends kept showing while other users' events never arrived, which a device build hit in an encrypted room. The snapshot is now retried with a capped backoff.
Modified file: crates/matrix-sdk-ui/src/timeline/tasks.rs+9 additions−4 deletions
@@ -268,17 +268,22 @@ pub(in crate::timeline) async fn room_event_cache_updates_task(
268268 // The updates might have lagged, but the room event cache might have
269269 // events, so retrieve them and add them back again to the timeline,
270270 // after clearing it.
271- let (initial_events, gaps, subscriber) =
271+ // giving up here would leave the timeline alive and silent for good, still
272+ // showing its own sends from the send queue, so a failing store read is retried
273+ let mut pause = std::time::Duration::from_millis(250);
274+ let (initial_events, gaps, subscriber) = loop {
272275 match room_event_cache.subscribe_with_history().await {
273- Ok(initial_events) => initial_events,
276+ Ok(initial_events) => break initial_events,
274277 Err(err) => {
275278 error!(
276279 ?err,
277280 "Failed to replace the initial remote events in the event cache"
278281 );
279- break;
282+ matrix_sdk::sleep::sleep(pause).await;
283+ pause = (pause * 2).min(std::time::Duration::from_secs(10));
280284 }
281- };
285+ }
286+ };
282287
283288 room_event_cache_subscriber = subscriber;