feat(sync/v3): Remove TL size config option in favor of using the sync filter

This commit is contained in:
Ginger
2025-11-05 14:23:30 -05:00
parent b20000fcf3
commit 3b8b9d4b5c
5 changed files with 33 additions and 24 deletions
+15 -2
View File
@@ -21,7 +21,10 @@ use crate::client::{
TimelinePdus, ignored_filter,
sync::{
load_timeline,
v3::{SyncContext, prepare_lazily_loaded_members, state::build_state_initial},
v3::{
DEFAULT_TIMELINE_LIMIT, SyncContext, prepare_lazily_loaded_members,
state::build_state_initial,
},
},
};
@@ -148,19 +151,29 @@ pub(super) async fn load_left_room(
.await?
.saturating_sub(1)
};
// end the timeline at the user's leave event
let timeline_end_count = services
.rooms
.timeline
.get_pdu_count(leave_pdu.event_id())
.await?;
// limit the timeline using the same logic as for joined rooms
let timeline_limit = filter
.room
.timeline
.limit
.and_then(|limit| limit.try_into().ok())
.unwrap_or(DEFAULT_TIMELINE_LIMIT);
let timeline = load_timeline(
services,
syncing_user,
room_id,
Some(timeline_start_count),
Some(timeline_end_count),
services.config.incremental_sync_max_timeline_size,
timeline_limit,
)
.await?;