Skip to content

fix: stop task dispatch after an interrupted tick - #62

Merged
onury merged 1 commit into
onury:masterfrom
bensynapse:fix-interrupted-tick-dispatch
Sep 28, 2026
Merged

onury merged 1 commit into
onury:masterfrom
bensynapse:fix-interrupted-tick-dispatch

Conversation

@bensynapse

Copy link
Copy Markdown

I run Live Tennis API.

Calling pause() or stop() in a tick listener still runs that tick's tasks. Later tasks also run after an earlier task callback stops the timer.

Check the existing generation counter before dispatching each task. This also ends the old tick when a listener pauses and resumes immediately. Pending tasks then run on the next scheduled tick.

Eight cases cover listeners, task callbacks, reset and restart behavior. Five fail on master. npm test passes all 79 tests on Node 22 and 24, including lint and type checks. npm run build and npm run cover pass, with 100% coverage.

@onury
onury merged commit 8a19967 into onury:master Sep 28, 2026
@onury

onury commented Sep 28, 2026

Copy link
Copy Markdown
Owner

Thanks for this. Merged.

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