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

fix(useWebSocket): only reconnect if is the current ws socket #4161

Merged
merged 1 commit into from
Aug 24, 2024

Conversation

freakbite
Copy link
Contributor

Description

This PR addresses issue #4160.
It verifies when doing an autoReconnect that the ws and wsRef are pointing to the same object.
If the wsRef is pointing to something new, we should not try and reconnect the ws WebSocket, since it is considered stale.

@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Aug 19, 2024
@antfu antfu changed the title Only reconnect if current ws socket is wsRef socket fix(useWebSocket): only reconnect if is the current ws socket Aug 24, 2024
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Aug 24, 2024
@antfu antfu enabled auto-merge August 24, 2024 15:58
@antfu antfu added this pull request to the merge queue Aug 24, 2024
Merged via the queue into vueuse:main with commit e0e99c8 Aug 24, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm This PR has been approved by a maintainer size:XS This PR changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants