Skip to content
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

Change initial Sockette.timer value from 1 to -1 #67

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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.
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
1 participant