aboutsummaryrefslogtreecommitdiffstats
path: root/atuin-client/src/sync.rs
diff options
context:
space:
mode:
authorEllie Huxtable <ellie@elliehuxtable.com>2023-04-05 09:23:09 +0100
committerGitHub <noreply@github.com>2023-04-05 09:23:09 +0100
commit400544738b49ad227bb39a1eb2ade4e22980a3ff (patch)
treebaa540b7627a049c5f32c1af69d12ccd4bf162ef /atuin-client/src/sync.rs
parentClarify in docs (diff)
downloadatuin-400544738b49ad227bb39a1eb2ade4e22980a3ff.zip
Fix deleting history that doesn't exist yet (#844)
This can occur if history has been added + then deleted on a machine before it has a chance to be synced to a new one.
Diffstat (limited to '')
-rw-r--r--atuin-client/src/sync.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/atuin-client/src/sync.rs b/atuin-client/src/sync.rs
index 474084d7..e62a1483 100644
--- a/atuin-client/src/sync.rs
+++ b/atuin-client/src/sync.rs
@@ -95,8 +95,14 @@ async fn sync_download(
for i in remote_status.deleted {
// we will update the stored history to have this data
// pretty much everything can be nullified
- let h = db.load(i.as_str()).await?;
- db.delete(h).await?;
+ if let Ok(h) = db.load(i.as_str()).await {
+ db.delete(h).await?;
+ } else {
+ info!(
+ "could not delete history with id {}, not found locally",
+ i.as_str()
+ );
+ }
}
Ok((local_count - initial_local, local_count))