simpl-liste/tests
le king fu 7265c6cad4 fix(sync): sync on write with a request-budget scheduler and a 30 s interval
Every sync now goes through one scheduler (src/services/syncSchedule.ts,
pure and import-free): one sync at a time, a request during a sync gives a
single relaunch, a sliding budget of 6 real HTTP requests per 60 s (each
POST batch and each GET counted, initialMerge and initialReset included),
pushChanges sends the batches the budget allows (MAX_PUSH_BATCHES becomes a
ceiling) and the rest of the queue follows once the window frees, a 429
suspends the scheduler until Retry-After, and no sync starts during
initialMerge / initialReset.

The repositories call requestSync() (src/services/syncTrigger.ts, 2 s
debounce, single subscriber registered by _layout.tsx) after each outbox
write and after the Inbox repair transaction; outbox.ts and syncClient.ts
never do. _layout.tsx syncs on launch, every 30 s in the foreground, on
return to the foreground and on write through scheduleSync(); the Settings
button too. REVIEW.md and scripts/review-levels.py list the two new files
in the Sync row.

test: reproduces #178 (tests/syncSchedule.test.mjs, smoke guards)

Refs #178
Refs #167

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 20:54:33 -05:00
..
feedback.test.mjs feat(feedback): integrate Feedback Hub widget in Settings (#68) 2026-07-27 19:43:12 -04:00
hydration.test.mjs fix(sync): bound the wait on the persisted settings before the inbox repair 2026-10-25 20:35:06 -04:00
smoke.test.cjs fix(sync): sync on write with a request-budget scheduler and a 30 s interval 2026-11-02 20:54:33 -05:00
syncRules.test.mjs fix(sync): read the app inbox from the database and repair split devices 2026-10-25 20:20:24 -04:00
syncSchedule.test.mjs fix(sync): sync on write with a request-budget scheduler and a 30 s interval 2026-11-02 20:54:33 -05:00