base: Return early if we get a duplicate sync response.
parent
676633eec1
commit
993dc8264a
|
@ -633,6 +633,13 @@ impl BaseClient {
|
||||||
&self,
|
&self,
|
||||||
response: &mut api::sync::sync_events::Response,
|
response: &mut api::sync::sync_events::Response,
|
||||||
) -> Result<()> {
|
) -> Result<()> {
|
||||||
|
// The server might respond multiple times with the same sync token, in
|
||||||
|
// that case we already received this response and there's nothing to
|
||||||
|
// do.
|
||||||
|
if self.sync_token.read().await.as_ref() == Some(&response.next_batch) {
|
||||||
|
return Ok(());
|
||||||
|
}
|
||||||
|
|
||||||
*self.sync_token.write().await = Some(response.next_batch.clone());
|
*self.sync_token.write().await = Some(response.next_batch.clone());
|
||||||
|
|
||||||
#[cfg(feature = "encryption")]
|
#[cfg(feature = "encryption")]
|
||||||
|
|
Loading…
Reference in New Issue