Files
t3code/apps/web
Theo BrowneandClaude Opus 5 3c9f1db60f fix: decouple update-action release from the restart window
Cursor found three defects (one High) that shared a root cause: the
restart window had been given a second job — releasing the update
action — while the window itself deleted the evidence that job depended
on. Patching each symptom would have kept the coupling, so sawDisconnect
is gone.

The window is now write-once-and-expire. It is armed while the old
server is still connected, so nothing observed on the connection can
reliably end it early; presentation gates on the environment actually
being unavailable, which makes a window outliving its restart inert.
That removes both "a brief blip during install poisons the flag" and
"reconnecting clears the flag before the action can read it".

Releasing the action is now its own signal, independent of the window,
with the two shapes a rejected restart can take:
  - the environment went away and came back, so something restarted but
    did not deliver the new version; or
  - the window lapsed with the connection never dropping, so no restart
    ever happened (systemd refused it and rolled back).
The second is the High-severity case: previously nothing set the flag,
so the action stayed disabled for the full 12-minute window.

The decision is a pure exported predicate because the component harness
stubs useEffect. Verified by removing the lapsed-window branch, which
fails exactly the test covering that case.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
2026-07-24 17:13:30 -07:00
..
2026-06-29 22:57:48 +00:00