diff --git a/lib/core/src/sync/mod.rs b/lib/core/src/sync/mod.rs index 7590b8d26..a06645845 100644 --- a/lib/core/src/sync/mod.rs +++ b/lib/core/src/sync/mod.rs @@ -202,7 +202,7 @@ impl SyncService { if let Some(sync_state) = &maybe_sync_state { if sync_state.record_revision >= new_record.revision { log::info!("Remote record revision is lower or equal to the persisted one. Skipping update."); - return Ok(()) + return Ok(()); } } @@ -266,7 +266,9 @@ impl SyncService { succeded.push(record_id); } - self.persister.remove_incoming_records(succeded)?; + if !succeded.is_empty() { + self.persister.remove_incoming_records(succeded)?; + } Ok(()) } @@ -335,7 +337,9 @@ impl SyncService { succeded.push(record_id); } - self.persister.remove_sync_outgoing_changes(succeded)?; + if !succeded.is_empty() { + self.persister.remove_sync_outgoing_changes(succeded)?; + } Ok(()) }