Skip to content

fix: clear live state globals on solve reset - #35

Closed
maxidragon wants to merge 2 commits into
masterfrom
clear-live-state-on-solve-reset
Closed

maxidragon wants to merge 2 commits into
masterfrom
clear-live-state-on-solve-reset

Conversation

@maxidragon

@maxidragon maxidragon commented Oct 18, 2026 •

Copy link
Copy Markdown
Member

Problem

reset_solve_state clears the station's own solve state, so the screen correctly goes back to waiting for a competitor. It doesn't clear the globals that the once-a-second live state packet reads (INSPECTION_TIME, CURRENT_COMPETITOR, CURRENT_GROUP_ID, CURRENT_SESSION_ID). After a solve is submitted, cancelled or rejected, an empty station keeps reporting the previous competitor and their inspection time, and the live solving view shows a stale competitor.

Only hard_state_reset cleared them.

Change

Clear those globals in reset_solve_state, the same way hard_state_reset does.

Every caller means "this competitor is done or cancelled": solve submitted, card rejected or error with reset, the reset button, a delegate decision, and the e2e reset. Nothing reads these globals except the live state packet.

CURRENT_TIME is left as is. The stackmat loop overwrites it on every frame, and inspection_start only starts inspection when it reads 0.

CI fix

The toolchain is unpinned nightly, and a newer clippy added the needless_bool lint, which failed CI under -D warnings in should_skip_other_actions and the logger's enabled. Both now return the condition directly. Behaviour is unchanged. master hits the same failure until this is merged.

Testing

  • CI passes: fmt, plus build and clippy for v3 and v4.
  • Tested on a v4 station with a dev build of this branch (v4,sleep): once a solve is done, the live state no longer reports the previous competitor or their inspection time.

reset_solve_state cleared the station's own solve state but not the globals
read by the once-a-second live state packet. After a solve was submitted,
cancelled or rejected, an empty station kept reporting the previous
competitor, inspection time, group and session, so live solving views
showed a stale competitor.

Clear them the same way hard_state_reset does. CURRENT_TIME is left alone:
the stackmat loop overwrites it on every frame and inspection start relies
on it reading 0.
Newer nightly clippy flags if-guards that return a bool literal followed by
another literal, which fails CI under -D warnings. Return the condition
directly; behaviour is unchanged.
@maxidragon
maxidragon requested a review from filipton October 18, 2026 18:29
@maxidragon

Copy link
Copy Markdown
Member Author

Closing in favour of #34. On the refresh branch the live state packet reads directly from the solve state, and reset_solve replaces the whole solve state and clears the timer value, so an empty station no longer reports the previous competitor. #34's CI also passes on the current nightly without the clippy changes here.

@maxidragon maxidragon closed this Oct 18, 2026
@filipton
filipton deleted the clear-live-state-on-solve-reset branch October 18, 2026 19:07
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.

1 participant