agent: code-atomiser-fix — focusTimer rehydrate startTick invariant (Race-10)

Lock the invariant: the already-expired branch of rehydrate() must call
startTick() so the tick loop observes now >= completionFlashUntil and
auto-clears the flash. The call was already present; this commit adds
the inline comment so future edits cannot silently drop it.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-13 15:12:10 +01:00
parent 6aa6a434fb
commit 5ba761a4b8

View File

@@ -201,6 +201,11 @@ function createFocusTimerStore() {
completionFlashUntil = Date.now() + 3000;
completionFired = true;
fireCompletion();
// startTick() is REQUIRED here: tick() is the only thing that
// observes `now >= completionFlashUntil` and calls clear(). Without
// it, the completion flash would stay visible until the user
// interacts with the app. stopTick() runs via clear() once the
// flash window elapses.
startTick();
return;
}