You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If timer is cleared from inside of its handler, _onDone/finished callback (which I assume is not even public...?) gets called twice, which in case of timers bound to groups removes last timer from its list of managed timers.
indexOf on second call here returns -1 (since id has already been removed)
Wrapping this call with simple if to verify timer is still there seems to fix the problem, though, this should be properly handled in timer code - I'm not using intervals in my code, but it looks like interval cleared in its handler called after interval.resume() might get rescheduled as well. That would need a separate test, I guess...
Just dropped a quick fix in my fork (and one that might fix additional untested issue I mentioned regarding intervals). Sadly I stumbled upon this bug during a very busy week so can't get proper tests done. Informatic@e3b0b98
Hey.
I just discovered an intersting case.
If timer is cleared from inside of its handler,
_onDone
/finished
callback (which I assume is not even public...?) gets called twice, which in case of timers bound to groups removes last timer from its list of managed timers.pauseable.js/lib/index.js
Line 42 in 501d6ab
indexOf
on second call here returns-1
(sinceid
has already been removed)Wrapping this call with simple
if
to verify timer is still there seems to fix the problem, though, this should be properly handled intimer
code - I'm not using intervals in my code, but it looks like interval cleared in its handler called afterinterval.resume()
might get rescheduled as well. That would need a separate test, I guess...Minimal testcase follows:
https://gist.github.com/81e656a7f06276081cf148283500c49e
The text was updated successfully, but these errors were encountered: