openclaw/extensions
Marcus Castro 2b154e0458
fix(mattermost): add WebSocket reconnection with exponential backoff (#14962)
* fix(mattermost): add WebSocket reconnection with exponential backoff

Fixes #13980

The Mattermost WebSocket monitor had no error handling around the
reconnection loop. When connectOnce() threw (e.g. 'fetch failed' from
network issues), the error propagated through the while loop, causing
the gateway to log 'channel exited' and never restart.

Extract runWithReconnect() utility that:
- Catches thrown errors from connectFn and retries
- Uses exponential backoff (2s→4s→8s→...→60s cap)
- Resets backoff after successful connections
- Stops cleanly on abort signal
- Reports errors and reconnect delays via callbacks

* fix(mattermost): make backoff sleep abort-aware and reject on WS connect failure

* fix(mattermost): clean up abort listener on normal timeout to prevent leak

* fix(mattermost): skip error reporting when abort causes connection rejection

* fix(mattermost): use try/finally for abort listener cleanup in connectOnce

* fix: force-close WebSocket on error to prevent reconnect hang

* fix: use ws.terminate() on abort for reliable teardown during CONNECTING state

* fix(mattermost): use initial retry delay for reconnect backoff

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-02-14 03:10:22 +01:00
..
bluebubbles fix(ci): fix discord proxy websocket binding and bluebubbles timeout status 2026-02-13 19:35:55 +00:00
copilot-proxy fix(ci): sync extension versions to root release (#15199) 2026-02-13 05:54:03 +01:00
device-pair TypeScript: add extensions to tsconfig and fix type errors (#12781) 2026-02-09 10:05:38 -08:00
diagnostics-otel fix(ci): sync extension versions to root release (#15199) 2026-02-13 05:54:03 +01:00
discord fix(ci): sync extension versions to root release (#15199) 2026-02-13 05:54:03 +01:00
feishu refactor(extensions): extract feishu dedup and mattermost onchar helpers 2026-02-13 19:08:37 +00:00
google-antigravity-auth fix(ci): sync extension versions to root release (#15199) 2026-02-13 05:54:03 +01:00
google-gemini-cli-auth test: migrate suites to e2e coverage layout 2026-02-13 14:28:22 +00:00
googlechat fix(security): enforce bounded webhook body handling 2026-02-13 19:14:54 +01:00
imessage fix(ci): sync extension versions to root release (#15199) 2026-02-13 05:54:03 +01:00
irc fix(ci): sync extension versions to root release (#15199) 2026-02-13 05:54:03 +01:00
line fix(ci): sync extension versions to root release (#15199) 2026-02-13 05:54:03 +01:00
llm-task fix(ci): sync extension versions to root release (#15199) 2026-02-13 05:54:03 +01:00
lobster fix(ci): sync extension versions to root release (#15199) 2026-02-13 05:54:03 +01:00
matrix fix(media): recognize MP3 and M4A as voice-compatible audio (#15438) 2026-02-14 03:03:02 +01:00
mattermost fix(mattermost): add WebSocket reconnection with exponential backoff (#14962) 2026-02-14 03:10:22 +01:00
memory-core fix(ci): sync extension versions to root release (#15199) 2026-02-13 05:54:03 +01:00
memory-lancedb fix(ci): sync extension versions to root release (#15199) 2026-02-13 05:54:03 +01:00
minimax-portal-auth fix(ci): sync extension versions to root release (#15199) 2026-02-13 05:54:03 +01:00
msteams fix(security): enforce bounded webhook body handling 2026-02-13 19:14:54 +01:00
nextcloud-talk fix(security): enforce bounded webhook body handling 2026-02-13 19:14:54 +01:00
nostr fix(security): enforce bounded webhook body handling 2026-02-13 19:14:54 +01:00
open-prose fix(ci): sync extension versions to root release (#15199) 2026-02-13 05:54:03 +01:00
phone-control TypeScript: add extensions to tsconfig and fix type errors (#12781) 2026-02-09 10:05:38 -08:00
qwen-portal-auth TypeScript: add extensions to tsconfig and fix type errors (#12781) 2026-02-09 10:05:38 -08:00
signal fix(ci): sync extension versions to root release (#15199) 2026-02-13 05:54:03 +01:00
slack fix(slack): apply limit parameter to emoji-list action (#13421) 2026-02-13 18:20:41 +01:00
talk-voice Gateway/Plugins: device pairing + phone control plugins (#11755) 2026-02-08 18:07:13 +01:00
telegram fix(security): default standalone servers to loopback bind (#13184) 2026-02-13 16:39:56 +01:00
thread-ownership feat(slack): land thread-ownership from @DarlingtonDeveloper (#15775) 2026-02-13 23:37:05 +00:00
tlon fix(ci): sync extension versions to root release (#15199) 2026-02-13 05:54:03 +01:00
twitch test: migrate suites to e2e coverage layout 2026-02-13 14:28:22 +00:00
voice-call voice-call: hang up rejected inbounds, idempotency and logging (#15892) 2026-02-14 03:09:31 +01:00
whatsapp fix(ci): sync extension versions to root release (#15199) 2026-02-13 05:54:03 +01:00
zalo fix(security): enforce bounded webhook body handling 2026-02-13 19:14:54 +01:00
zalouser fix(ci): sync extension versions to root release (#15199) 2026-02-13 05:54:03 +01:00