Skip to content

Conversation

@stevium
Copy link

@stevium stevium commented Mar 19, 2022

This PR fixes the issue described in #66 by setting timer value to -1 which would still enable normal functionality of Sockette.reconnect, but at the same time, it will not by mistake clear any other timeouts/intervals.

Closes #66

Since first call to window.setTimeout or window.setInterval is returning
handle with ID 1 calling Sockette.close would unexpectedly clear that
timeout, because timer=1 is still a valid handle ID. This commit fixes
this by setting timer value to -1 which will still enable normal
functionality of Sockette.reconnect, but at the same time it will not by
mistake clear any other timeouts/intervals.
@atesgoral
Copy link

Bump Just wasted a whole bunch of time debugging because of this 😅

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.

Sockette.close can unexpectedly clear other timeouts/intervals

2 participants