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
While working on #134 I noticed that all scheduled calls will resolve the callback and then call reset, which sets timeout to undefined. I first though that this could lead to calls that are debounced while the callback handler is already running to not be cancelable. It turns out that they can simply get completely lost:
When the setTimeout is finally called, resolve can already be null from the previous runs reset call, which will lead to the actual callback to never be called.
While I don't think the later callback should simply be lost, this could be one of those: "It's a feature, not a bug" instances. Either way the behavior should be clearly documented.
Describe the bug
While working on #134 I noticed that all scheduled calls will resolve the callback and then call
reset
, which setstimeout
toundefined
. I first though that this could lead to calls that are debounced while the callback handler is already running to not be cancelable. It turns out that they can simply get completely lost:When the
setTimeout
is finally called,resolve
can already benull
from the previous runsreset
call, which will lead to the actual callback to never be called.While I don't think the later callback should simply be lost, this could be one of those: "It's a feature, not a bug" instances. Either way the behavior should be clearly documented.
Reproduction
https://stackblitz.com/edit/sveltejs-kit-template-default-bpdvwu?file=src%2Froutes%2F%2Bpage.svelte
Logs
No response
System Info
Severity
annoyance
The text was updated successfully, but these errors were encountered: