mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-06-13 10:54:21 -04:00
refactor(ffi): add debug logging when a latest event is not a standalone content item
This commit is contained in:
@@ -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)]
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user