You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I checked there isn't already an issue for the bug I encountered.
Viem Version
2.31.7
Current Behavior
When the WebSocket transport loses connection, the reconnection logic can cause it to open multiple connections. It's possible to get into a situation where neither the reconnection limit (default 5) nor the delay between new connection attempts are respected, and the client ends up creating lots of open WebSocket connections.
Expected Behavior
The WebSocket transport should only attempt to reconnect up to the specified number of times and space out each connection attempt by the specified delay.
There should only be one WebSocket connection (per server and settings) that should be shared by all clients using the WebSocket transport.
We also experience this situation when leaving the browser tab in the background for a while. The network throttling approach described above is how we can consistently reproduce it.
Check existing issues
Viem Version
2.31.7
Current Behavior
When the WebSocket transport loses connection, the reconnection logic can cause it to open multiple connections. It's possible to get into a situation where neither the reconnection limit (default 5) nor the delay between new connection attempts are respected, and the client ends up creating lots of open WebSocket connections.
Expected Behavior
Steps To Reproduce
Steps to reproduce:
alvrs/websocket-repropnpm install && pnpm buildat rootpnpm install && pnpm dev --forceat/environments/vitehttp://localhost:5173/rpc.redstonechain.comCleanShot.2025-07-16.at.15.49.31.mp4
Link to Minimal Reproducible Example
latticexyz#1
Anything else?
We also experience this situation when leaving the browser tab in the background for a while. The network throttling approach described above is how we can consistently reproduce it.