diff --git a/crates/matrix-sdk-ui/src/timeline/event_handler.rs b/crates/matrix-sdk-ui/src/timeline/event_handler.rs index 01753c013..134707aec 100644 --- a/crates/matrix-sdk-ui/src/timeline/event_handler.rs +++ b/crates/matrix-sdk-ui/src/timeline/event_handler.rs @@ -145,6 +145,20 @@ pub(super) enum HandleAggregationKind { PollEnd, } +impl HandleAggregationKind { + /// Returns a small string describing this aggregation, for debug purposes. + pub fn debug_string(&self) -> &'static str { + match self { + HandleAggregationKind::Reaction { .. } => "a reaction", + HandleAggregationKind::Redaction => "a redaction", + HandleAggregationKind::Edit { .. } => "an edit", + HandleAggregationKind::PollResponse { .. } => "a poll response", + HandleAggregationKind::PollEdit { .. } => "a poll edit", + HandleAggregationKind::PollEnd => "a poll end", + } + } +} + /// An action that we want to cause on the timeline. #[derive(Clone, Debug)] #[allow(clippy::large_enum_variant)] diff --git a/crates/matrix-sdk-ui/src/timeline/latest_event.rs b/crates/matrix-sdk-ui/src/timeline/latest_event.rs index ff4f4ffd0..bccce2489 100644 --- a/crates/matrix-sdk-ui/src/timeline/latest_event.rs +++ b/crates/matrix-sdk-ui/src/timeline/latest_event.rs @@ -15,6 +15,7 @@ use matrix_sdk::{Client, Room, latest_events::LocalLatestEventValue}; use matrix_sdk_base::latest_event::LatestEventValue as BaseLatestEventValue; use ruma::{MilliSecondsSinceUnixEpoch, OwnedUserId}; +use tracing::trace; use crate::timeline::{ Profile, TimelineDetails, TimelineItemContent, event_handler::TimelineAction, @@ -121,6 +122,9 @@ impl LatestEventValue { } TimelineAction::HandleAggregation { kind, .. } => { + // Add some debug logging here to help diagnose issues with the latest + // event. + trace!("latest event is an aggregation: {}", kind.debug_string()); Self::None } }