diff --git a/src/api/client/sync/v5.rs b/src/api/client/sync/v5.rs index 32b5e785..af02c022 100644 --- a/src/api/client/sync/v5.rs +++ b/src/api/client/sync/v5.rs @@ -23,7 +23,7 @@ use ruma::{ }; use tokio::time::{Instant, timeout_at}; use tuwunel_core::{ - Result, apply, at, + Err, Result, apply, at, debug::INFO_SPAN_LEVEL, err, error::inspect_log, @@ -119,6 +119,10 @@ pub(crate) async fn sync_events_v5_route( let (mut conn, _) = join(conn, ping_presence).await; + if conn.next_batch != since { + return Err!(Request(UnknownPos("Requesting unknown or duplicate 'pos' parameter."))); + } + conn.update_cache(request); conn.globalsince = since; conn.next_batch = since;