refactor(sync/v3): Split load_joined_room into smaller functions

This commit is contained in:
Ginger
2025-11-10 12:37:11 -05:00
parent 3f4749a796
commit 07dfc5528d
9 changed files with 625 additions and 343 deletions
+5 -2
View File
@@ -4,7 +4,7 @@ mod v5;
use std::collections::VecDeque;
use conduwuit::{
Event, PduCount, Result,
Event, PduCount, Result, err,
matrix::pdu::PduEvent,
ref_at, trace,
utils::stream::{BroadbandExt, ReadyExt, TryIgnore},
@@ -54,7 +54,10 @@ async fn load_timeline(
.rooms
.timeline
.last_timeline_count(Some(sender_user), room_id)
.await?;
.await
.map_err(|err| {
err!(Database(warn!("Failed to fetch end of room timeline: {}", err)))
})?;
if last_timeline_count <= starting_count {
// no messages have been sent in this room since `starting_count`