Skip to content

fix: prevent timer from getting stuck after skip or restart#413

Merged
Splode merged 1 commit intoSplode:mainfrom
guerlain-hitier:fix-timer-skip-reset-race
Apr 29, 2026
Merged

fix: prevent timer from getting stuck after skip or restart#413
Splode merged 1 commit intoSplode:mainfrom
guerlain-hitier:fix-timer-skip-reset-race

Conversation

@guerlain-hitier
Copy link
Copy Markdown
Contributor

@guerlain-hitier guerlain-hitier commented Apr 29, 2026

Issue

Timer can get stuck after skipping or restarting round. After that, pressing start/play may do nothing.

Cause

After skip or reset, timer listener sends a follow-up Reconfigure to load next round duration.

If user starts next round before that command lands, Reconfigure can arrive while engine is already running and force it back to Idle.

That leaves engine state out of sync with UI and makes timer appear stuck.

Fix

Add a lightweight Prime command to timer engine.

Prime updates stored duration for next round without changing engine phase.

Use Prime instead of Reconfigure in post-Complete and post-Reset paths, so next-round duration is updated without interrupting a fresh start.

Late duration sync could hit after a fresh start and push the engine back to Idle.

Prime the next round duration without changing phase and cover the race with a regression test.
@Splode
Copy link
Copy Markdown
Owner

Splode commented Apr 29, 2026

LGTM. Thank you for the contribution!

@Splode Splode merged commit 4d5f3df into Splode:main Apr 29, 2026
5 checks passed
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.

2 participants