Skip to content

fix(masthead): restart_needed means a restart HELPS — behind boards get their own cue - #1722

Merged
OrangePeachPink merged 1 commit into
mainfrom
dx/1712-restart-needed
Sep 5, 2026
Merged

fix(masthead): restart_needed means a restart HELPS — behind boards get their own cue#1722
OrangePeachPink merged 1 commit into
mainfrom
dx/1712-restart-needed

Conversation

@OrangePeachPink

Copy link
Copy Markdown
Owner

Closes #1712. All three ACs, though the diagnosis in the filing was wrong and the real one is sharper.

There is no mtime comparison

The filing guessed at "an mtime-vs-process-start comparison that trips on file touches that aren't builds." There isn't one. The flag was a single expression:

"restart_needed": bool(server.get("stale")) or bool(behind),

Observed state had server_stale: false — so behind was the trigger. That's a logical certainty from the code, not an inference: nothing else writes this flag.

Two conditions, one sentence, different remedies

condition actual remedy
server_stale restart the Monitor ✅
behind (board on older fw) flash the board — restarting does nothing

The operator was told to do something that cannot work.

The part I didn't expect

The masthead already has the right cue for behind boards:

if(V.restart_needed) cue = `↻ newer build — restart the Monitor`;
else if(V.firmware.behind.length) cue = `N boards on older fw (latest X)`;

It's an else if after restart_needed. So while behind fed that flag, the accurate message was unreachable — every behind board rendered the restart prompt instead. The right words were written, shipped, and could never appear.

Fixing the flag is what lets that cue render for the first time.

The change

  • restart_needed = server_stale. behind is untouched and still published in the firmware block — it just stops claiming a restart is the answer.
  • The tooltip loses "or a board is behind" (the conflation, stated out loud) and now says restarting does not reflash a board.

One test asserted the bug

test_device_behind_latest_firmware_is_flagged asserted restart_needed is True for a behind board — the defect written down as an expectation. Amended rather than deleted, with the reason in place, so a reader hitting that diff sees a corrected model rather than a fixture tweak.

ACs

  • AC1 — derives from the versions block's own facts. Pinned by a test asserting restart_needed tracks server_stale exactly, so a third condition can't be folded in later without bringing its own cue and remedy.
  • AC2 — tree == running build → no banner. ✅
  • AC3 — genuinely newer checkout still triggers it. ✅

Deliberately not changed

When the server is stale and boards are behind, the restart cue still wins the else if. That precedence predates this, and showing both is a masthead-density question rather than an honesty one — the cue that remains is true in that state. Flagging it rather than quietly widening scope.

just check green; 16 masthead tests.

Lane note: card_context.py is analytics. The board assigns this to DX and the ACs are precise, so I took it — but if Data would rather own changes in that module, say so and I'll route it instead of assuming the board settles it.

— DX

…et their own cue

The filing guessed at "an mtime-vs-process-start comparison that trips on file
touches that aren't builds". There is no such comparison. The flag was one
expression:

    "restart_needed": bool(server.get("stale")) or bool(behind)

Observed state had server_stale false, so `behind` was the trigger — a logical
certainty from the code, not an inference: nothing else writes this flag.

Two conditions were sharing one flag and one sentence, and they have DIFFERENT
REMEDIES. A stale server is fixed by restarting the Monitor. A board on older
firmware is fixed by FLASHING THE BOARD — restarting does nothing for it. The
operator was told to do something that cannot work.

The sharper half: the masthead ALREADY has the correct cue for behind boards —

    N boards on older fw (latest X)     [tooltip: device @ fw, ...]

— and it sits in an `else if` AFTER restart_needed. So while `behind` fed that
flag, the accurate message was UNREACHABLE. Every behind board rendered "newer
build - restart the Monitor" instead. The right words were written, shipped, and
could never appear.

Fix: restart_needed = server_stale. `behind` is untouched and still published in
the firmware block; it simply no longer claims a restart is the answer, which
lets the correct cue render for the first time.

The tooltip loses "or a board is behind" — that clause was the conflation stated
out loud — and now says restarting does not reflash a board.

One test asserted `restart_needed is True` for a behind board. That was the
defect written down as an expectation, so it is amended rather than deleted, with
the reason in place: a reader hitting that diff should see a corrected model, not
a fixture tweak.

Deliberately NOT changed: when the server is stale AND boards are behind, the
restart cue still wins the `else if`. That precedence predates this and showing
both is a masthead-density question, not an honesty one — the remaining cue is
true in that state.

AC1's intent is pinned by a test asserting restart_needed tracks server_stale
exactly, so a third condition cannot be folded in later without bringing its own
cue and its own remedy.

Refs #1712

Lane: DX
@OrangePeachPink
OrangePeachPink merged commit b735a89 into main Sep 5, 2026
6 checks passed
@OrangePeachPink
OrangePeachPink deleted the dx/1712-restart-needed branch September 5, 2026 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(masthead): 'newer build — restart' renders while app==server and server_stale=false — restart_needed contradicts its own versions block

1 participant