Files
whatsmeow/statusupdate.go
Alexandre Possebom 19bd3a9126
Go / Build (old) (push) Failing after 5m18s
Go / Build (latest) (push) Failing after 5m18s
client: ack channel <status> stanzas to stop 50-minute stream recycling
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>.
2026-07-15 18:02:16 -03:00

23 lines
784 B
Go

// 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)()
}