{{ message }}
Repository navigation
racer: consistently end the race when the clock flags - #21965
Draft
Zinkelburger wants to merge 1 commit into
Draft
Zinkelburger wants to merge 1 commit into
Zinkelburger wants to merge 1 commit into
Conversation
Only the clock view's 100ms tick ends a run when time runs out, and that view is only rendered while status() is 'racing'. status() switched to 'post' as soon as the clock flagged, so a redraw landing between the flag and the next tick (the 1s redraw interval, a racerState message) unmounted the clock first: end() never ran, the board stayed movable, and the last puzzle was missing from the history. Derive 'post' from run.endAt instead, and split end() the way storm does: end() finalises once, endNow() records the puzzle left on the board, for players only. Moves made after the flag end the race rather than counting locally when the server would reject the score. Opening a race that is already over goes straight to 'post' as before. This also stops the last puzzle being recorded twice when every puzzle is played. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
ornicar
marked this pull request as draft
October 8, 2026 09:05
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.

I was having issues/inconsistencies where in puzzle racer, sometimes the last puzzle would be shown as unfinished, and sometimes not shown at all.
AI Description:
Only the clock view's 100ms tick ends a run when time runs out, and that view is only rendered while status() is 'racing'. status() switched to 'post' as soon as the clock flagged, so a redraw landing between the flag and the next tick (the 1s redraw interval, a racerState message) unmounted the clock first: end() never ran, the board stayed movable, and the last puzzle was missing from the history.
Derive 'post' from run.endAt instead, and split end() the way storm does: end() finalises once, endNow() records the puzzle left on the board, for players only. Moves made after the flag end the race rather than counting locally when the server would reject the score. Opening a race that is already over goes straight to 'post' as before.
This also stops the last puzzle being recorded twice when every puzzle is played.
I tested it in a local lila instance
Claude Opus 5.5 prompt: