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

Unable to disconnect if React Component is unmounted before ref=(client)=> async call #139

Open
dsmingtsoi opened this issue Nov 27, 2019 · 3 comments

Comments

@dsmingtsoi
Copy link

dsmingtsoi commented Nov 27, 2019

Hi

I am facing an issue while trying to disconnect the webstocket connection after render call and then unmounted immediately.

base on your example, I created a component to bring up the web socket connection when render call, however if the user click on something immediately after that and then unmounted, client ref may not be passed successfully while the connection could be up and running in background. On this case i found that we got some active web socket session in the background and keep receiving message

Any suggestion?

Thanks
Ming

@DIVANSHMAHAJAN
Copy link

Did u find any solution for this problem . I am also facing the same problem as a result of which multiple notifications are coming after I click on something else and return back .

@matinfo
Copy link

matinfo commented Apr 2, 2022

I have same problem. Each time for example I click on a form the websocket connection is disconnected and reconnected immediately. Same each time I switch to an other page in my application.

result intempestive disconnection/reconnection and lot of : Stomp WebSocket Error in the console.

Notice: I need to inject bearer token in header, result the context is placed not at top in index.js, but just after in App.js to be able to get authentication access_token.

@lucasrodrigues19
Copy link

I'm experiencing the same issue, when opening a connection socket and disassembling the component, after trying to connect again, the previous connection is still in the background.

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

No branches or pull requests

4 participants