Issue Description
After a period of inactivity, the client appears connected but cannot send or receive messages. No disconnected event is emitted. The socket is internally frozen in a ghost [OPENING] state where the underlying WebSocket no longer exists (wsReadyState: null).
Inspecting the connection state reveals:
{ "socketState": "OPENING", "socketStream": "DISCONNECTED", "wsReadyState": null, "hasSynced": true, "connWid": null }
The only way to recover is to close and reopen the browser. This behavior does not occur in versions prior to 1.34.7.
Reproduction Steps
Initialize a client and wait for the ready event
Leave the session idle for a while (especially in Docker or behind a NAT/firewall)
Attempt to send a message — it silently fails with no error or disconnect event
Check the connection state
const info = await client.pupPage.evaluate(() => { const socket = window.require('WAWebSocketModel').Socket; const ws = socket.socket; return { socketState: socket.state, socketStream: socket.stream, wsReadyState: ws ? ws.readyState : null, hasSynced: socket.hasSynced, connWid: socket.wid ?? null, }; }); console.log(info);
Observe: socketState: "OPENING", socketStream: "DISCONNECTED", wsReadyState: null
Closing and reopening the browser resolves the issue
Environment:
whatsapp-web.js version: 1.34.7
Node.js: v20.x
Platform: Docker / Linux / NAT network
Code Sample
User Setup
| WhatsApp |
Type |
| Account Type |
Standard |
| Authentication Strategy |
RemoteAuth |
| WhatsApp Web Version |
0000000000 |
| whatsapp-web.js Version |
1.34.7 |
| Environment |
Version |
| Browser Type |
chrome |
| Browser Version |
0000 |
| Phone OS Version |
android |
| Running OS Version |
ubuntu |
| Node.js Version |
20x |
Checklist
Issue Description
After a period of inactivity, the client appears connected but cannot send or receive messages. No disconnected event is emitted. The socket is internally frozen in a ghost [OPENING] state where the underlying WebSocket no longer exists (wsReadyState: null).
Inspecting the connection state reveals:
{ "socketState": "OPENING", "socketStream": "DISCONNECTED", "wsReadyState": null, "hasSynced": true, "connWid": null }The only way to recover is to close and reopen the browser. This behavior does not occur in versions prior to 1.34.7.
Reproduction Steps
Initialize a client and wait for the ready event
Leave the session idle for a while (especially in Docker or behind a NAT/firewall)
Attempt to send a message — it silently fails with no error or disconnect event
Check the connection state
const info = await client.pupPage.evaluate(() => { const socket = window.require('WAWebSocketModel').Socket; const ws = socket.socket; return { socketState: socket.state, socketStream: socket.stream, wsReadyState: ws ? ws.readyState : null, hasSynced: socket.hasSynced, connWid: socket.wid ?? null, }; }); console.log(info);Observe: socketState: "OPENING", socketStream: "DISCONNECTED", wsReadyState: null
Closing and reopening the browser resolves the issue
Environment:
whatsapp-web.js version: 1.34.7
Node.js: v20.x
Platform: Docker / Linux / NAT network
Code Sample
User Setup
Checklist