perf: Don't re-process events as outliers

This commit is contained in:
timedout authored and Jade Ellis committed 2026-06-27 19:49:41 +01:00
1 parent d090f5d769
commit 9633a37421
1 file changed
+8
@@ -81,6 +81,14 @@ impl super::Service {
CanonicalJsonValue::String(event_id.as_str().to_owned()),
);
if let Ok(pdu_event) = self.services.timeline.get_pdu(event_id).await {
debug!(
"Already have event {event_id} as an outlier or timeline event, not \
re-processing"
);
return Ok((pdu_event, incoming_pdu));
}
let pdu_event = serde_json::from_value::<PduEvent>(
serde_json::to_value(&incoming_pdu).expect("CanonicalJsonObj is a valid JsonValue"),
)