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

feat: reconnect socket automatically on close event #270

Closed
wants to merge 3 commits into from

Conversation

lukeocodes
Copy link
Contributor

No description provided.

@lukeocodes lukeocodes added the enhancement New feature or request label Apr 25, 2024
Copy link
Contributor

@dvonthenen dvonthenen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just checking to see if these are desired or not.

}

this._reconnections += 1;
this._unregisterEvents();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would the user be interested in getting the onopen event to know that the WS successfully reconnected?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We reregister the events after. These internal events emit an external one, which won't need to be reregistered. So they're likely to get second onopen event... which may be troublesome for some actually

test/live.test.ts Show resolved Hide resolved
@lukeocodes lukeocodes marked this pull request as draft April 26, 2024 16:19
@lukeocodes
Copy link
Contributor Author

I need to get the key factory in and documented before this, and I may change this to be a method users can call rather than automatically reconnect

@lukeocodes lukeocodes closed this May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants