summaryrefslogtreecommitdiffhomepage
path: root/packages/api
diff options
context:
space:
mode:
authorAdam Malczewski <[email protected]>2026-06-01 10:42:00 +0900
committerAdam Malczewski <[email protected]>2026-06-01 10:42:00 +0900
commit68afd41be364acd03520837bdf456ba13efd45e4 (patch)
tree90e16e0ddb12a74361a640d3bfce8d8f784e396f /packages/api
parentecce93d9dfecd0c61c0f8c3fa8024f60359e1f17 (diff)
downloaddispatch-68afd41be364acd03520837bdf456ba13efd45e4.tar.gz
dispatch-68afd41be364acd03520837bdf456ba13efd45e4.zip
fix(frontend): ClaudeReset — global snapshot sequencer fixes cross-hour race
Replaces the per-hour inFlightSeq with a single shared SnapshotSequencer used by both loadFromServer() and postToggle() (Gemini #2, High; nit #4). The bug: applySnapshot replaces the *whole* schedule object. The old per-hour counter could not stop request A for hour 9 (knows only about hour 9) from clobbering request B for hour 10 (knows about both) when B returned first and A straggled in — hour 10 would visually vanish. Same race existed between the initial-mount loadFromServer and a quick user toggle: whichever lost the race won the UI. Fix: every request to /models/wake-schedule (GET and POST) bumps a single monotonic seq. On response, sequencer.accept(seq) returns false if any newer request has already won; we drop the snapshot. Also drops the inFlightSeq mechanism entirely — it was redundant with pendingHours for user clicks AND insufficient for the cross-hour and initial-load races, so two mechanisms became one.
Diffstat (limited to 'packages/api')
0 files changed, 0 insertions, 0 deletions