refactor(ffi): add debug logging when a latest event is not a standalone content item

This commit is contained in:
Benjamin Bouvier
2025-09-30 18:00:13 +02:00
parent f4451b5c82
commit 248d77a4d9
2 changed files with 18 additions and 0 deletions

View File

@@ -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)]

View File

@@ -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
}
}