ui: Improve logging for timeline resets

This commit is contained in:
Jonas Platte
2023-11-27 16:27:16 +01:00
committed by Jonas Platte
parent bfe79468c6
commit 932f12e76d
2 changed files with 7 additions and 2 deletions

View File

@@ -180,11 +180,16 @@ impl TimelineBuilder {
let mut ignore_user_list_stream = client.subscribe_to_ignore_user_list_changes();
let ignore_user_list_update_join_handle = spawn({
let inner = inner.clone();
let span = info_span!(parent: Span::none(), "ignore_user_list_update_handler", room_id = ?room.room_id());
span.follows_from(Span::current());
async move {
while ignore_user_list_stream.next().await.is_some() {
inner.clear().await;
}
}
.instrument(span)
});
// Not using room.add_event_handler here because RoomKey events are

View File

@@ -649,8 +649,6 @@ impl TimelineInnerStateTransaction<'_> {
}
fn clear(&mut self) {
trace!("Clearing timeline");
// By first checking if there are any local echoes first, we do a bit
// more work in case some are found, but it should be worth it because
// there will often not be any, and only emitting a single
@@ -686,6 +684,8 @@ impl TimelineInnerStateTransaction<'_> {
self.fully_read_event = None;
self.event_should_update_fully_read_marker = false;
self.back_pagination_tokens.clear();
debug!(remaining_items = self.items.len(), "Timeline cleared");
}
#[instrument(skip_all)]