From d0daddfb849c1fab74c7132e4f468e87494fd034 Mon Sep 17 00:00:00 2001 From: Dwynr Date: Sat, 23 Nov 2024 04:20:18 +0100 Subject: [PATCH] fix: localToCloud/cloudBackup/twoWay mode deletions --- package-lock.json | 4 ++-- package.json | 2 +- src/lib/deltas.ts | 6 ++---- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2a290de..e192674 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@filen/sync", - "version": "0.1.82", + "version": "0.1.84", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@filen/sync", - "version": "0.1.82", + "version": "0.1.84", "license": "AGPLv3", "dependencies": { "@filen/sdk": "^0.1.183", diff --git a/package.json b/package.json index 2932e1d..c2a56f5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@filen/sync", - "version": "0.1.83", + "version": "0.1.84", "description": "Filen Sync", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/src/lib/deltas.ts b/src/lib/deltas.ts index 325410d..4a6bed3 100644 --- a/src/lib/deltas.ts +++ b/src/lib/deltas.ts @@ -216,8 +216,7 @@ export class Deltas { // Local deletions if (this.sync.mode === "twoWay" || this.sync.mode === "localToCloud") { - // Only run current/previous comparisons if the sync already has saved state - if (this.sync.mode === "twoWay" && !this.sync.isPreviousSavedTreeStateEmpty) { + if (this.sync.mode === "twoWay") { for (const path in previousLocalTree.tree) { if (pathsAdded[path] || erroredLocalPaths[path]) { continue @@ -278,8 +277,7 @@ export class Deltas { // Remote deletions if (this.sync.mode === "twoWay" || this.sync.mode === "cloudToLocal") { - // Only run current/previous comparisons if the sync already has saved state - if (this.sync.mode === "twoWay" && !this.sync.isPreviousSavedTreeStateEmpty) { + if (this.sync.mode === "twoWay") { for (const path in previousRemoteTree.tree) { if (pathsAdded[path]) { continue