From bf9d49862100cc81a881310215f9dd40762c24a9 Mon Sep 17 00:00:00 2001 From: morguldir Date: Fri, 30 Aug 2024 18:20:18 +0200 Subject: [PATCH] syncv3: check timestamps of all the rooms in the timeline --- src/api/client/sync.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/api/client/sync.rs b/src/api/client/sync.rs index b99dc5e8..d95a88ff 100644 --- a/src/api/client/sync.rs +++ b/src/api/client/sync.rs @@ -1549,9 +1549,9 @@ pub(crate) async fn sync_events_v4_route( let mut timestamp: Option<_> = None; for (_, pdu) in timeline_pdus { - if DEFAULT_BUMP_TYPES.contains(pdu.event_type()) { - timestamp = Some(MilliSecondsSinceUnixEpoch(pdu.origin_server_ts)); - break; + let ts = MilliSecondsSinceUnixEpoch(pdu.origin_server_ts); + if DEFAULT_BUMP_TYPES.contains(pdu.event_type()) && !timestamp.is_some_and(|time| time > ts) { + timestamp = Some(ts); } }