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.
This commit is contained in:
parent
f2a496848a
commit
400544738b
1 changed files with 8 additions and 2 deletions
|
@ -95,8 +95,14 @@ async fn sync_download(
|
||||||
for i in remote_status.deleted {
|
for i in remote_status.deleted {
|
||||||
// we will update the stored history to have this data
|
// we will update the stored history to have this data
|
||||||
// pretty much everything can be nullified
|
// pretty much everything can be nullified
|
||||||
let h = db.load(i.as_str()).await?;
|
if let Ok(h) = db.load(i.as_str()).await {
|
||||||
db.delete(h).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))
|
Ok((local_count - initial_local, local_count))
|
||||||
|
|
Loading…
Reference in a new issue