fix(retry): resolve message-not-found

fix(retry): resolve message-not-found
This commit is contained in:
Renato Alcara
2026-02-26 19:29:38 -03:00
committed by GitHub
parent 9c1adfd05f
commit 416ad47789
+7 -2
View File
@@ -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(),