v1.0.32: fix manual sync loop via WorkManager tag monitor

Root cause: manual sync triggered from the UI had no cooldown set in
FileWatchService, so file writes during any manual sync fired FileObserver
→ debounce → another sync → loop.

Fix: startSyncMonitor() subscribes to getWorkInfosByTagFlow("sync_$pairId")
and watches ALL sync work for each pair — manual, catchup, onchange — via
the tag that SyncWorker.buildOneTimeRequest() always adds.
  - When any sync is RUNNING or ENQUEUED: cooldown extended to now+120s
  - When sync transitions from running to finished: 60s settle cooldown
  - Monitor job stored in syncMonitorJobs map and cancelled in clearWatchers()

This means no matter what triggers a sync, FileObserver events from the
resulting file writes are always suppressed until the folder settles.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-25 14:11:58 +00:00
parent 66d28761a8
commit 4b20697bb1
2 changed files with 35 additions and 4 deletions
+2 -2
View File
@@ -1,2 +1,2 @@
VERSION_NAME=1.0.31
VERSION_CODE=32
VERSION_NAME=1.0.32
VERSION_CODE=33