mirror of
https://forgejo.ellis.link/continuwuation/continuwuity/
synced 2026-08-28 03:24:10 +00:00
fix: Properly remove event_id from the PDU JSON before upgrading it
This commit is contained in:
@@ -158,7 +158,9 @@ pub(super) async fn fetch_and_handle_missing_events<'a, Pdu>(
|
||||
}
|
||||
if let Ok(local_pdu) = self.services.timeline.get_pdu(&next_id).await {
|
||||
trace!("Found {next_id} in db");
|
||||
seeded_events.insert(next_id.clone(), local_pdu.into_canonical_object());
|
||||
let mut obj = local_pdu.into_canonical_object();
|
||||
obj.remove("event_id");
|
||||
seeded_events.insert(next_id.clone(), obj);
|
||||
continue;
|
||||
}
|
||||
let attempts = seen.get(&*next_id).copied().unwrap_or_default();
|
||||
@@ -205,7 +207,9 @@ pub(super) async fn fetch_and_handle_missing_events<'a, Pdu>(
|
||||
for auth_event_id in auth_events {
|
||||
if let Ok(local_pdu) = self.services.timeline.get_pdu(&next_id).await {
|
||||
trace!("Found auth event {next_id} in db");
|
||||
seeded_events.insert(id.clone(), local_pdu.into_canonical_object());
|
||||
let mut obj = local_pdu.into_canonical_object();
|
||||
obj.remove("event_id");
|
||||
seeded_events.insert(id.clone(), obj);
|
||||
continue;
|
||||
}
|
||||
if seeded_events.contains_key(&auth_event_id) {
|
||||
@@ -245,6 +249,7 @@ pub(super) async fn fetch_and_handle_missing_events<'a, Pdu>(
|
||||
for id in seeded_ordered {
|
||||
let pdu_json = seeded_events.remove(&id).unwrap();
|
||||
debug_info!("Handling missing event {id} as outlier");
|
||||
assert_eq!(pdu_json.get("event_id"), None, "pdu_json had event_id");
|
||||
match Box::pin(self.handle_outlier_pdu(
|
||||
origin,
|
||||
create_event,
|
||||
|
||||
Reference in New Issue
Block a user