From 416ad4778936e4620242d7130248fc02ddcdc0a8 Mon Sep 17 00:00:00 2001 From: Renato Alcara Date: Thu, 26 Feb 2026 19:29:38 -0300 Subject: [PATCH] fix(retry): resolve message-not-found fix(retry): resolve message-not-found --- src/Socket/socket.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Socket/socket.ts b/src/Socket/socket.ts index 405140ff..f90d866a 100644 --- a/src/Socket/socket.ts +++ b/src/Socket/socket.ts @@ -1263,8 +1263,13 @@ export const makeSocket = (config: SocketConfig) => { if (diff > keepAliveIntervalMs + 5000) { void end(new Boom('Connection was lost', { statusCode: DisconnectReason.connectionLost })) } else if (ws.isOpen) { - // if its all good, send a keep alive request - query({ + // Send keep-alive ping via sendNode() (fire-and-forget) instead of query(). + // query() wraps the ping in the query circuit breaker — when that breaker is + // open or timing out, the ping is never sent, WA never responds, lastDateRecv + // goes stale, and the diff check above wrongly fires "Connection was lost". + // sendNode() bypasses the query circuit breaker entirely; WA's ping response + // still arrives as an incoming frame and updates lastDateRecv normally. + sendNode({ tag: 'iq', attrs: { id: generateMessageTag(),