fix(sync): run watched sync when a scheduled --sync hits the running instance #12

Merged
debont80 merged 1 commits from fix/scheduled-sync-running-instance into main 2026-07-09 15:48:32 -04:00
Owner

Found during an end-to-end review of the watched-source auto-download feature.

Bug: the Windows daily-sync task launches AeroFetch.exe --sync, but the single-instance lock routes that relaunch to the second-instance handler whenever AeroFetch is already open. The handler only focused the window and looked for a link -- it never checked isSyncLaunch(argv) -- so the sync never ran. The daily auto-download of new watched-source uploads silently did nothing for minimize-to-tray / always-on users (and the relaunch stole window focus each day).

Fix: a new runWatchedSync main->renderer push. On a --sync relaunch the handler nudges the renderer to run syncWatched() instead of focusing, so the daily sync fires whether AeroFetch was closed or already running.

Verified green: typecheck, lint, 416 tests, full build. The live second-instance path needs a real install smoke test (same category as the rest of the scheduler/protocol wiring, which unit tests and the browser preview can't exercise).

Found during an end-to-end review of the watched-source auto-download feature. **Bug:** the Windows daily-sync task launches `AeroFetch.exe --sync`, but the single-instance lock routes that relaunch to the `second-instance` handler whenever AeroFetch is already open. The handler only focused the window and looked for a link -- it never checked `isSyncLaunch(argv)` -- so the sync never ran. The daily auto-download of new watched-source uploads silently did nothing for minimize-to-tray / always-on users (and the relaunch stole window focus each day). **Fix:** a new `runWatchedSync` main->renderer push. On a `--sync` relaunch the handler nudges the renderer to run `syncWatched()` instead of focusing, so the daily sync fires whether AeroFetch was closed or already running. Verified green: typecheck, lint, 416 tests, full build. The live second-instance path needs a real install smoke test (same category as the rest of the scheduler/protocol wiring, which unit tests and the browser preview can't exercise).
debont80 added 1 commit 2026-07-09 15:46:56 -04:00
The Windows daily-sync task launches `AeroFetch.exe --sync`, but the single-
instance lock routes that relaunch to the `second-instance` handler whenever
AeroFetch is already open. The handler only focused the window and looked for a
link -- it never checked `isSyncLaunch(argv)` -- so the sync never ran. The daily
auto-download of new watched-source uploads therefore did nothing for minimize-
to-tray / always-on users (and the relaunch stole window focus each day).

Add a `runWatchedSync` main->renderer push: on a `--sync` relaunch the handler
now nudges the renderer to run syncWatched() instead of focusing, so the daily
sync fires whether AeroFetch was closed or already running.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
debont80 merged commit af9c285864 into main 2026-07-09 15:48:32 -04:00
debont80 deleted branch fix/scheduled-sync-running-instance 2026-07-09 15:48:36 -04:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: debont80/AeroFetch#12