You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHub’s verified signature.
Jitter before retry: adds a random 1–3 s delay before the single re-try doCycle call that follows a PRECONDITION_FAILED response. Two clients (macOS Electron + Android) polling every ~60 s on similar schedules previously collided on every cycle; the jitter breaks the lock-step pattern so they desynchronise after the first collision.
Backoff on failed retry: when the one-shot retry itself fails, the engine now increments downloadErrorCount, computes the same exponential backoff used for all other transient errors (30 × 2^(n−1) seconds, capped at MAX_DOWNLOAD_BACKOFF_S), sets downloadBackoffUntil, emits an 'error' status, and calls onError. Previously it logged and silently returned — the engine would then hammer the server again on the very next 60 s poll.
Version bump: 1.0.0 → 1.0.1 in package.json / package-lock.json, with a CHANGELOG.md entry.
Tests: existing 412 retry test updated to use vi.useFakeTimers() with a 6 s advance (3 s max jitter + 2 s upload MIN_SYNC_DURATION hold + 1 s buffer — the previous 4 s advance was non-deterministic when Math.random() > 0.5). New test covers the failed-retry → backoff path. 124/124 tests pass.