From b0a5caf57606b34baa94afc5f348d0484f5c0f3b Mon Sep 17 00:00:00 2001 From: timedout Date: Fri, 16 Oct 2026 18:32:38 +0100 Subject: [PATCH] perf: Fetch auth chain events in parallel --- src/api/server/event_auth.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/api/server/event_auth.rs b/src/api/server/event_auth.rs index 5cd49b834..f4ed82f6d 100644 --- a/src/api/server/event_auth.rs +++ b/src/api/server/event_auth.rs @@ -1,7 +1,10 @@ use std::{borrow::Borrow, iter::once}; use axum::extract::State; -use conduwuit::{Err, Event, Result, info, utils::stream::ReadyExt}; +use conduwuit::{ + Err, Event, Result, info, + utils::stream::{BroadbandExt, ReadyExt}, +}; use futures::StreamExt; use ruma::api::federation::authorization::get_event_authorization; @@ -64,7 +67,9 @@ pub(crate) async fn get_event_authorization_route( .auth_chain .event_ids_iter(&body.room_id, once(body.event_id.borrow())) .ready_filter_map(Result::ok) - .filter_map(|id| async move { services.rooms.timeline.get_pdu_json(&id).await.ok() }) + .broad_filter_map( + |id| async move { services.rooms.timeline.get_pdu_json(&id).await.ok() }, + ) .then(|pdu| services.sending.convert_to_outgoing_federation_event(pdu)) .collect() .await;