-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Queue'd Timer Callbacks still execute even after timer is cleared #135
Comments
Thanks, I'll take a look. |
Fixed |
@kbuffington , I think I'll have to revert the fix for this issue, because I don't think I can fix all the problems that this fix brings. |
That's fine. I'll revert my revert of my fixes then :) |
I found some weird behavior that is an issue with FSM, but maybe on the actual SM side of the things? I encountered an issue where a queued setInterval callback (i.e. the interval had fired, but code had not been executed) had it's spawning timer cleared, and then afterwards the callback was still executed.
What's supposed to happen is that before the callback executes the timerId is checked to see if it's still valid, and if not it's discarded. See this SO answer. Here's the code snippet:
You can run that code snippet in any browser and the interval will only execute once. However if you paste that into a FSM panel, the interval will execute 3 times (the initial time and then two more queued callbacks while the busyWait function is spinning for a second). This completely threw me for a loop and I spent a couple hours debugging before I realized the queue'd callbacks were still executing after the clear. Not sure if this is fixable, but my workaround is super ugly so I figured I should let you know :)
The text was updated successfully, but these errors were encountered: