Unbox and pin database streams.

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk
2025-11-24 09:12:14 +00:00
parent 98affbdeaf
commit 71f3ccf140
26 changed files with 217 additions and 166 deletions

View File

@@ -108,6 +108,7 @@ pub fn room_state_keys_with_ids<'a>(
.map_ok(|shortstatehash| {
self.state_keys_with_ids(shortstatehash, event_type)
.map(Ok)
.boxed()
})
.map_err(move |e| err!(Database("Missing state for {room_id:?}: {e:?}")))
.try_flatten_stream()
@@ -127,6 +128,7 @@ pub fn room_state_keys<'a>(
.map_ok(|shortstatehash| {
self.state_keys(shortstatehash, event_type)
.map(Ok)
.boxed()
})
.map_err(move |e| err!(Database("Missing state for {room_id:?}: {e:?}")))
.try_flatten_stream()

View File

@@ -249,7 +249,6 @@ pub fn state_keys_with_shortids<'a>(
.ignore_err()
.unzip()
.map(|(ssks, sids): (Vec<u64>, Vec<u64>)| (ssks, sids))
.boxed()
.shared();
let shortstatekeys = short_ids
@@ -410,7 +409,6 @@ pub fn state_full_shortids(
.map_ok(Vec::into_iter)
.map_ok(IterStream::try_stream)
.try_flatten_stream()
.boxed()
}
#[implement(super::Service)]