diff --git a/crates/matrix-sdk-ui/src/timeline/builder.rs b/crates/matrix-sdk-ui/src/timeline/builder.rs index 8a6dd8a27..2105474a4 100644 --- a/crates/matrix-sdk-ui/src/timeline/builder.rs +++ b/crates/matrix-sdk-ui/src/timeline/builder.rs @@ -172,8 +172,11 @@ impl TimelineBuilder { let update = match event_subscriber.recv().await { Ok(up) => up, Err(broadcast::error::RecvError::Closed) => break, - Err(broadcast::error::RecvError::Lagged(_)) => { - warn!("Lagged behind sync responses, resetting timeline"); + Err(broadcast::error::RecvError::Lagged(num_skipped)) => { + warn!( + num_skipped, + "Lagged behind event cache updates, resetting timeline" + ); inner.clear().await; continue; } diff --git a/crates/matrix-sdk/src/event_cache/mod.rs b/crates/matrix-sdk/src/event_cache/mod.rs index 8b0f93cb7..d5a333afd 100644 --- a/crates/matrix-sdk/src/event_cache/mod.rs +++ b/crates/matrix-sdk/src/event_cache/mod.rs @@ -203,11 +203,11 @@ impl EventCache { } } - Err(RecvError::Lagged(_)) => { + Err(RecvError::Lagged(num_skipped)) => { // Forget everything we know; we could have missed events, and we have // no way to reconcile at the moment! // TODO: implement Smart Matching™, - warn!("Lagged behind room updates, clearing all rooms"); + warn!(num_skipped, "Lagged behind room updates, clearing all rooms"); // Note: one must NOT clear the `by_room` map, because if something subscribed // to a room update, they would never get any new update for that room, since @@ -460,7 +460,7 @@ impl RoomEventCacheInner { /// Creates a new cache for a room, and subscribes to room updates, so as /// to handle new timeline events. fn new(room: Room) -> Self { - let sender = Sender::new(32); + let sender = Sender::new(128); Self { room,