Hoist room_version query to callers of get_auth_chain.

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk committed 2026-01-22 09:31:46 +00:00
1 parent afcb2315ee
commit 48aa6035f6
8 files changed
+49 -59

No files matched your search

+7 -1
View File
@@ -57,11 +57,17 @@ pub(super) async fn get_auth_chain(&self, event_id: OwnedEventId) -> Result {
let room_id = <&RoomId>::try_from(room_id_str)
.map_err(|_| err!(Database("Invalid room id field in event in database")))?;
let room_version = self
.services
.state
.get_room_version(room_id)
.await?;
let start = Instant::now();
let count = self
.services
.auth_chain
.event_ids_iter(room_id, once(event_id.as_ref()))
.event_ids_iter(room_id, &room_version, once(event_id.as_ref()))
.ready_filter_map(Result::ok)
.count()
.await;