aboutsummaryrefslogtreecommitdiffstats
path: root/atuin-client/src/sync.rs
diff options
context:
space:
mode:
Diffstat (limited to 'atuin-client/src/sync.rs')
-rw-r--r--atuin-client/src/sync.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/atuin-client/src/sync.rs b/atuin-client/src/sync.rs
index 1c0acaf8..474084d7 100644
--- a/atuin-client/src/sync.rs
+++ b/atuin-client/src/sync.rs
@@ -111,6 +111,9 @@ async fn sync_upload(
) -> Result<()> {
debug!("starting sync upload");
+ let remote_status = client.status().await?;
+ let remote_deleted: HashSet<String> = HashSet::from_iter(remote_status.deleted.clone());
+
let initial_remote_count = client.count().await?;
let mut remote_count = initial_remote_count;
@@ -157,6 +160,10 @@ async fn sync_upload(
let deleted = db.deleted().await?;
for i in deleted {
+ if remote_deleted.contains(&i.id) {
+ continue;
+ }
+
info!("deleting {} on remote", i.id);
client.delete_history(i).await?;
}