Skip to content

Commit

Permalink
Merge branch 'master' into fix-issue-3014
Browse files Browse the repository at this point in the history
  • Loading branch information
abraunegg authored Nov 28, 2024
2 parents d1d8095 + 44d639c commit 0803206
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/sync.d
Original file line number Diff line number Diff line change
Expand Up @@ -2830,7 +2830,7 @@ class SyncEngine {
// Was this item previously in-sync with the local system?
// We previously searched for the file in the DB, we need to use that record
if (fileFoundInDB) {
// Purge DB record so that the deleted local file does not cause an online delete
// Purge DB record so that the deleted local file does not cause an online deletion
// In a --dry-run scenario, this is being done against a DB copy
addLogEntry("Removing DB record due to failed integrity checks");
itemDB.deleteById(databaseItem.driveId, databaseItem.id);
Expand All @@ -2847,6 +2847,16 @@ class SyncEngine {
} // end of (!disableDownloadValidation)
} else {
addLogEntry("ERROR: File failed to download. Increase logging verbosity to determine why.");
// Was this item previously in-sync with the local system?
// We previously searched for the file in the DB, we need to use that record
if (fileFoundInDB) {
// Purge DB record so that the deleted local file does not cause an online deletion
// In a --dry-run scenario, this is being done against a DB copy
addLogEntry("Removing existing DB record due to failed file download.");
itemDB.deleteById(databaseItem.driveId, databaseItem.id);
}

// Flag that the download failed
downloadFailed = true;
}
}
Expand Down

0 comments on commit 0803206

Please sign in to comment.