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
[Bug]: Lost connection is not detected if no messages are being sent over WebSocket #12219
Comments
This issue was not reproducible. Please check that your example runs locally and the following:
Once the above checks are satisfied, please edit your issue with the changes and we will |
I am not able to reproduce:
starts printing close once the socket connection is closed. Could you provide more details about how exactly you close the socket? |
I believe the primary concern is related to the I think this ticket is related by this: #1774 This is a very important issue / feature when you want to keep the browser running for a long time without interacting with it. |
I see what you mean now. We rely on the close event from the client https://github.com/websockets/ws to update the connection status. It looks the client does not auto-detect broken connections. |
We should probably implement a keepAlive option on the websocket transports and implement the ping/pong to keep the connection alive as described here https://github.com/websockets/ws?tab=readme-ov-file#how-to-detect-and-close-broken-connections |
For now I'am requesting |
Minimal, reproducible example
When i connect to a puppeteer browser, the sockets are closed after a while. But the browser stays connected.
browser.connected === true
I can reproduce it when I'am closing the sockets of
process.env.BROWSER_WS_ENDPOINT
that puppeteer is still running and the browser is still connected until I run an action like:This scripts throws the error:
The text was updated successfully, but these errors were encountered: