Fix sliding-sync again by resetting after interrupted requests. (fixes #190)
This solution is not elegant but appears to be correct for fixing the issue. A a more efficient solution might be possible without resetting the connection which should be further investigated. Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user