client: ack channel <status> stanzas to stop 50-minute stream recycling
Go / Build (old) (push) Failing after 5m18s
Go / Build (latest) (push) Failing after 5m18s

The server delivers channel status updates as <status> stanzas. Without a
registered node handler they were dropped unacked, so the server redelivered
them on every connect and closed the stream every 50 minutes with
<stream:error><ack class="status" .../></stream:error>.
This commit is contained in:
Alexandre Possebom
2026-07-15 18:02:16 -03:00
parent d8960d9575
commit 19bd3a9126
2 changed files with 23 additions and 0 deletions
+1
View File
@@ -295,6 +295,7 @@ func NewClient(deviceStore *store.Device, log waLog.Logger) *Client {
"chatstate": cli.handleChatState,
"presence": cli.handlePresence,
"notification": cli.handleNotification,
"status": cli.handleStatusUpdate,
"success": cli.handleConnectSuccess,
"failure": cli.handleConnectFailure,
"stream:error": cli.handleStreamError,
+22
View File
@@ -0,0 +1,22 @@
// Copyright (c) 2026 Tulir Asokan
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
package whatsmeow
import (
"context"
waBinary "go.mau.fi/whatsmeow/binary"
)
// handleStatusUpdate acknowledges <status> stanzas (channel status updates).
// The content isn't parsed into events yet, but the stanza must be acked:
// otherwise the server redelivers it on every connect and recycles the
// connection every 50 minutes with
// <stream:error><ack class="status" id="..." type="..."/></stream:error>.
func (cli *Client) handleStatusUpdate(ctx context.Context, node *waBinary.Node) {
defer cli.maybeDeferredAck(ctx, node)()
}