macsync/@packages/imessage
Natalie ab44591b8a fix(imessage): stop blob sync starving the periodic read cycle
The iMessage read cycle is driven by BaseSyncManager's 30s timer →
syncNow(), which is gated by 'guard !isSyncing'. performSync awaited
blobSyncManager.syncBlobs() inline, and that blob pass infinite-loops
when the upload backend is failing: /attachments/missing has no cursor,
so a full page of perpetually-failing uploads is re-fetched and re-failed
forever, the loop only breaking on a < pageSize page. performSync never
returned → isSyncing stuck true → every 30s read tick swallowed. Net
effect: messages only synced on app launch, drifting hours behind between
restarts (send-queue timers are independent, so they kept polling — the
tell that the timer fired but syncNow was gated).

Two fixes:
- Decouple the blob pass: fire it detached + in-flight-guarded instead of
  awaiting it on the read cycle, so a slow/failing blob backend can never
  hold isSyncing.
- Bound the blob loop: stop a pass after any full page that produced zero
  successful uploads (the same missing set would be re-fetched), instead
  of spinning forever.

Verified: read cycle now fires every ~30s on the live process without a
restart; blob pass logs 'stopping pass' and returns; store lag ~7s.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-23 14:37:40 -04:00
..
Sources/IMessageSync fix(imessage): stop blob sync starving the periodic read cycle 2026-06-23 14:37:40 -04:00
Tests/IMessageSyncTests feat(@applications/@mac-sync): add async actor-based iMessage sender with timeout guard 2026-05-22 01:56:05 -07:00