From feba68779bb40b2092e489bdd20842e260c93ea4 Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Fri, 6 Oct 2023 13:46:07 +0200 Subject: [PATCH] Remove build as parent span of room_update_handler MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit … but record the relationship between them using follows_from. --- crates/matrix-sdk-ui/src/timeline/builder.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/crates/matrix-sdk-ui/src/timeline/builder.rs b/crates/matrix-sdk-ui/src/timeline/builder.rs index a00a03ae1..d230bfbf1 100644 --- a/crates/matrix-sdk-ui/src/timeline/builder.rs +++ b/crates/matrix-sdk-ui/src/timeline/builder.rs @@ -24,7 +24,7 @@ use ruma::events::{ AnySyncTimelineEvent, }; use tokio::sync::{broadcast, mpsc, Notify}; -use tracing::{error, info, info_span, trace, warn, Instrument}; +use tracing::{error, info, info_span, trace, warn, Instrument, Span}; #[cfg(feature = "e2e-encryption")] use super::to_device::{handle_forwarded_room_key_event, handle_room_key_event}; @@ -176,6 +176,11 @@ impl TimelineBuilder { let room_update_join_handle = spawn({ let sync_response_notify = sync_response_notify.clone(); let inner = inner.clone(); + + let span = + info_span!(parent: Span::none(), "room_update_handler", room_id = ?room.room_id()); + span.follows_from(Span::current()); + async move { loop { let update = match room_update_rx.recv().await { @@ -205,7 +210,7 @@ impl TimelineBuilder { sync_response_notify.notify_waiters(); } } - .instrument(info_span!("room_update_handler", room_id = ?room.room_id())) + .instrument(span) }); let mut ignore_user_list_stream = client.subscribe_to_ignore_user_list_changes();