-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
fix(useWebSocket): urlRef changes were not being tracked #3870
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
Conversation
Signed-off-by: GitHub <noreply@github.com>
If I haven't opened the WebSocket, I believe it shouldn't be opened directly when the URL changes. It should maintain the current state. Even when the immediate parameter is set to false, I think regardless of the current WebSocket state, it should be closed directly. |
@GarlandQian In that case, what's the benefit of using useWebSocket instead of the "raw" WebSocket instance? This is a regression, not a new feature. |
Sorry to jump in here: this just arose as a "bug" in our internal app. I was surprised with the behavior, especially since I use |
@DrColossos First of all, this PR fixed a regression, so that behaviour worked in your application by "taking advantage" of that regression. But according to what's stated in the docs, what you say is the behaviour that it should have. In either case, in my opinion the docs are incorrect and the implementation is right: in all other composables, In your case, I think your logic can easily be simplified: why not have that URL be computed (or |
Thank you for you info. I was reading the Anyways, thanks for clarification! |
Before submitting the PR, please make sure you do the following
fixes #123
).Description
URLRef changes were not being tracked inside useWebSocket