macsync/@packages
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
..
contacts-sync-core apricot baseline: contacts-sync-core + BlobSyncManager + embedding/search/sync-history 2026-05-15 17:05:39 -07:00
ical merge batch 1: top-level metadata, shared, ical, imail 2026-05-15 18:02:04 -07:00
imail merge batch 1: top-level metadata, shared, ical, imail 2026-05-15 18:02:04 -07:00
imessage fix(imessage): stop blob sync starving the periodic read cycle 2026-06-23 14:37:40 -04:00
inotes merge: restore plum-only additive files atop apricot baseline 2026-05-15 17:06:07 -07:00
iphoto feat(@applications): implement mac-sync identity and photo workflows 2026-05-17 20:27:05 -07:00
ireminders merge: restore plum-only additive files atop apricot baseline 2026-05-15 17:06:07 -07:00
shared fix(@applications/@mac-sync): 🐛 update lan instead of local in all configs 2026-06-10 03:12:06 -07:00