Files
EvoGO/pkg
EcoosUP fc35d72029 fix(whatsmeow): back off the reconnect loop instead of spinning forever
An instance whose device was logged out from the phone never stops restarting:

    Disconnected -> ReconnectClient -> instance comes up with no session
    -> QR -> nobody scans -> max QR count -> forced logout -> Disconnected

Measured in production: 110 reconnects and 1135 QR codes in 50 minutes from a
single instance, stopping only when a human noticed.

Nothing counted those restarts, because from ReconnectClient's point of view
every turn succeeds — the instance really does come up. What fails afterwards is
the pairing, and nobody was measuring that.

The first 5 restarts inside a 15 minute window still go straight through: that
is the good case, a healthy instance that lost its websocket and has to return
within seconds. Past that the loop becomes a growing wait (5, 15, 30 minutes)
and the instance keeps trying — a backoff, not a give-up.

Only one goroutine waits per instance. Without that guard, every Disconnected
arriving during the wait would stack another one and the backoff would become
the loop it was written to stop.

(cherry picked from commit 3b52f1c457406dc2540f7e17467b6c30e9304f7b)
2026-11-09 12:01:35 -03:00
..
2026-03-25 12:40:16 -03:00
2026-03-25 12:40:16 -03:00