Rebox future segmentations.

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk
2025-07-08 11:48:45 +00:00
parent aac49b09c7
commit 18f8d6c65c
14 changed files with 43 additions and 32 deletions

View File

@@ -2,7 +2,7 @@ use std::{borrow::Borrow, collections::HashMap, iter::once, sync::Arc};
use axum::extract::State;
use axum_client_ip::InsecureClientIp;
use futures::{FutureExt, StreamExt};
use futures::{FutureExt, StreamExt, pin_mut};
use ruma::{
CanonicalJsonObject, CanonicalJsonValue, OwnedRoomId, OwnedServerName, OwnedUserId, RoomId,
RoomVersionId, UserId,
@@ -747,7 +747,7 @@ async fn join_room_by_id_helper_local(
})
.await
{
services
let users = services
.rooms
.state_cache
.local_users_in_room(room_id)
@@ -759,10 +759,10 @@ async fn join_room_by_id_helper_local(
&state_lock,
)
})
.boxed()
.next()
.await
.map(ToOwned::to_owned)
.map(ToOwned::to_owned);
pin_mut!(users);
users.next().await
} else {
None
}

View File

@@ -100,7 +100,6 @@ pub(crate) async fn get_message_events_route(
.rooms
.timeline
.backfill_if_required(room_id, from)
.boxed()
.await
.log_err()
.ok();

View File

@@ -175,7 +175,7 @@ async fn paginate_relations_with_filter(
})
}
async fn visibility_filter<Pdu: Event + Send + Sync>(
async fn visibility_filter<Pdu: Event>(
services: &Services,
sender_user: &UserId,
item: (PduCount, Pdu),

View File

@@ -728,7 +728,6 @@ async fn load_joined_room(
joined_since_last_sync,
witness.as_ref(),
)
.boxed()
.await?;
let is_sender_membership = |pdu: &PduEvent| {
@@ -1075,8 +1074,7 @@ async fn calculate_state_incremental<'a>(
.rooms
.state_accessor
.state_full_shortids(current_shortstatehash)
.expect_ok()
.boxed(),
.expect_ok(),
)
})
.into();
@@ -1108,6 +1106,7 @@ async fn calculate_state_incremental<'a>(
.ok()
})
.collect::<Vec<_>>()
.boxed()
.await;
let (device_list_updates, left_encrypted_users) = state_events