From ea9c7ca526613bf7a9fa225a6be2ebefebca0e4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C4=93sperus?= Date: Fri, 10 Jul 2026 01:58:14 +0800 Subject: [PATCH] fix(decider): fix local_norecord_remote race condition (#168) Fixes #166 --- manifest.json | 2 +- src/sync/decision/two-way.decider.function.ts | 17 ++++++----------- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/manifest.json b/manifest.json index 2fec6f4..af37a5b 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "webdav-sync", "name": "WebDAV Sync", - "version": "2.5.11", + "version": "2.5.12", "minAppVersion": "1.12.3", "authorUrl": "https://hesprs.github.io", "description": "General-purpose & bidirectional WebDAV syncing for your vault. Designed for stability and robust file handling without vendor lock-in.", diff --git a/src/sync/decision/two-way.decider.function.ts b/src/sync/decision/two-way.decider.function.ts index 5a84f55..dae1905 100644 --- a/src/sync/decision/two-way.decider.function.ts +++ b/src/sync/decision/two-way.decider.function.ts @@ -146,17 +146,12 @@ export default function twoWayDecider(input: SyncDecisionInput): Array : 'RECORD_NOREMOTE_LOCAL_REMOVE'; } } else if (remote) - if (local) { - localChanged = isChanged({ - currentStats: localStats, - path, - records, - source: 'local', - }); - caseName = localChanged - ? 'NORECORD_REMOTE_LOCAL_RECORD' - : 'NORECORD_REMOTE_LOCAL_CONFLICT'; - } else caseName = 'NORECORD_REMOTE_NOLOCAL_PULL'; + if (local) + caseName = + local.size === remote.size + ? 'NORECORD_REMOTE_LOCAL_RECORD' + : 'NORECORD_REMOTE_LOCAL_CONFLICT'; + else caseName = 'NORECORD_REMOTE_NOLOCAL_PULL'; else if (local) caseName = 'NORECORD_NOREMOTE_LOCAL_PUSH'; const operations = {