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

WebSocket client disconnection #324

Open
mweidner037 opened this issue Mar 21, 2024 · 1 comment
Open

WebSocket client disconnection #324

mweidner037 opened this issue Mar 21, 2024 · 1 comment

Comments

@mweidner037
Copy link

For testing purposes (especially testing concurrent operations), it would be convenient if I could programmatically disconnect and reconnect a BrowserWebSocketClientAdapter - as if the connection dropped.

I tried calling disconnect() on the adapter, but it does not actually close the socket, just let the server know that we are leaving. So the local repo continues syncing with other peers.

@nikgraf
Copy link

nikgraf commented Jul 6, 2024

If you store the browserWebSocketClientAdapter separately you can call browserWebSocketClientAdapter.socket?.close();. That said currently automerge-repo will continue trying to reconnect based on the retryInterval

Would be great to completely close a socket.

My use-case is: a user logs out of the application and everything should be closed

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

2 participants