fix: remote deletions not mirrored when file has no state record

When a file was uploaded before state-tracking worked (getFileMetadata was
broken), its SyncFileStateEntity was never saved. On next sync the engine
saw !local + remote + known=null and downloaded it back instead of deleting
it remotely, creating an infinite re-download loop.

Fix: syncDecide() now accepts hasPriorSyncState (derived from whether the
pair has any known states at all). On initial sync (no prior state) unknown
remote files are downloaded as before. Once the pair has been synced, unknown
remote-only files are treated as mirror-eligible deletions — same as if known
state existed — so locally-deleted files propagate to the remote correctly.

Verified live: 3 remote-only orphan files deleted from Nextcloud on sync.
Bump version to 1.0.12 (code 13).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-24 02:18:27 +00:00
parent 1d6a80e43d
commit 3d7a8b5f3d
3 changed files with 34 additions and 7 deletions
+2 -2
View File
@@ -1,2 +1,2 @@
VERSION_NAME=1.0.11
VERSION_CODE=12
VERSION_NAME=1.0.12
VERSION_CODE=13