Repository navigation
fix: clear live state globals on solve reset - #35
Closed
maxidragon wants to merge 2 commits into
Closed
maxidragon wants to merge 2 commits into
maxidragon wants to merge 2 commits into
Conversation
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.
Member
Author
|
Closing in favour of #34. On the refresh branch the live state packet reads directly from the solve state, and |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
reset_solve_stateclears 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_resetcleared them.Change
Clear those globals in
reset_solve_state, the same wayhard_state_resetdoes.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_TIMEis left as is. The stackmat loop overwrites it on every frame, andinspection_startonly starts inspection when it reads0.CI fix
The toolchain is unpinned
nightly, and a newer clippy added theneedless_boollint, which failed CI under-D warningsinshould_skip_other_actionsand the logger'senabled. Both now return the condition directly. Behaviour is unchanged.masterhits the same failure until this is merged.Testing
v4,sleep): once a solve is done, the live state no longer reports the previous competitor or their inspection time.