openclaw/extensions
Jason 9d3e653ec9
fix(web): handle 515 Stream Error during WhatsApp QR pairing (#27910)
* fix(web): handle 515 Stream Error during WhatsApp QR pairing

getStatusCode() never unwrapped the lastDisconnect wrapper object,
so login.errorStatus was always undefined and the 515 restart path
in restartLoginSocket was dead code.

- Add err.error?.output?.statusCode fallback to getStatusCode()
- Export waitForCredsSaveQueue() so callers can await pending creds
- Await creds flush in restartLoginSocket before creating new socket

Fixes #3942

* test: update session mock for getStatusCode unwrap + waitForCredsSaveQueue

Mirror the getStatusCode fix (err.error?.output?.statusCode fallback)
in the test mock and export waitForCredsSaveQueue so restartLoginSocket
tests work correctly.

* fix(web): scope creds save queue per-authDir to avoid cross-account blocking

The credential save queue was a single global promise chain shared by all
WhatsApp accounts. In multi-account setups, a slow save on one account
blocked credential writes and 515 restart recovery for unrelated accounts.

Replace the global queue with a per-authDir Map so each account's creds
serialize independently. waitForCredsSaveQueue() now accepts an optional
authDir to wait on a single account's queue, or waits on all when omitted.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* test: use real Baileys v7 error shape in 515 restart test

The test was using { output: { statusCode: 515 } } which was already
handled before the fix. Updated to use the actual Baileys v7 shape
{ error: { output: { statusCode: 515 } } } to cover the new fallback
path in getStatusCode.

Co-Authored-By: Claude Code (Opus 4.6) <noreply@anthropic.com>

* fix(web): bound credential-queue wait during 515 restart

Prevents restartLoginSocket from blocking indefinitely if a queued
saveCreds() promise stalls (e.g. hung filesystem write).

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: clear flush timeout handle and assert creds queue in test

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: evict settled credsSaveQueues entries to prevent unbounded growth

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: share WhatsApp 515 creds flush handling (#27910) (thanks @asyncjason)

---------

Co-authored-by: Jason Separovic <jason@wilma.dog>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Ayaan Zaidi <hi@obviy.us>
2026-03-15 17:00:07 +05:30
..
acpx build: sync plugins for 2026.3.14 2026-03-14 06:05:39 +00:00
bluebubbles feat(gateway): make health monitor stale threshold and max restarts configurable (openclaw#42107) 2026-03-14 21:21:56 -05:00
copilot-proxy build: sync plugins for 2026.3.14 2026-03-14 06:05:39 +00:00
device-pair refactor: share device pair ipv4 parsing 2026-03-13 23:35:27 +00:00
diagnostics-otel build: sync plugins for 2026.3.14 2026-03-14 06:05:39 +00:00
diffs build: sync plugins for 2026.3.14 2026-03-14 06:05:39 +00:00
discord Fix configure startup stalls from outbound send-deps imports (#46301) 2026-03-14 09:58:03 -07:00
feishu fix(plugins): prefer explicit installs over bundled duplicates (#46722) 2026-03-14 21:08:32 -05:00
google-gemini-cli-auth build: sync plugins for 2026.3.14 2026-03-14 06:05:39 +00:00
googlechat build: sync plugins for 2026.3.14 2026-03-14 06:05:39 +00:00
imessage Fix configure startup stalls from outbound send-deps imports (#46301) 2026-03-14 09:58:03 -07:00
irc build: sync plugins for 2026.3.14 2026-03-14 06:05:39 +00:00
line build: sync plugins for 2026.3.14 2026-03-14 06:05:39 +00:00
llm-task build: sync plugins for 2026.3.14 2026-03-14 06:05:39 +00:00
lobster build: sync plugins for 2026.3.14 2026-03-14 06:05:39 +00:00
matrix Fix configure startup stalls from outbound send-deps imports (#46301) 2026-03-14 09:58:03 -07:00
mattermost fix(mattermost): carry thread context to non-inbound reply paths (#44283) 2026-03-14 12:23:23 +05:30
memory-core build: sync plugins for 2026.3.14 2026-03-14 06:05:39 +00:00
memory-lancedb build: sync plugins for 2026.3.14 2026-03-14 06:05:39 +00:00
minimax-portal-auth build: sync plugins for 2026.3.14 2026-03-14 06:05:39 +00:00
msteams Fix configure startup stalls from outbound send-deps imports (#46301) 2026-03-14 09:58:03 -07:00
nextcloud-talk build: sync plugins for 2026.3.14 2026-03-14 06:05:39 +00:00
nostr build: sync plugins for 2026.3.14 2026-03-14 06:05:39 +00:00
ollama build: sync plugins for 2026.3.14 2026-03-14 06:05:39 +00:00
open-prose build: sync plugins for 2026.3.14 2026-03-14 06:05:39 +00:00
phone-control test: share plugin api test harness 2026-03-14 02:40:27 +00:00
qwen-portal-auth refactor(extensions): reuse shared helper primitives 2026-03-07 10:41:05 +00:00
sglang build: sync plugins for 2026.3.14 2026-03-14 06:05:39 +00:00
shared fix(ci): repair helper typing regressions 2026-03-14 03:22:53 +00:00
signal fix(ci): update vitest configs after channel move to extensions/ (openclaw#46066) 2026-03-14 13:23:25 -05:00
slack fix(ci): update vitest configs after channel move to extensions/ (openclaw#46066) 2026-03-14 13:23:25 -05:00
synology-chat build: sync plugins for 2026.3.14 2026-03-14 06:05:39 +00:00
talk-voice fix(discord): avoid native plugin command collisions 2026-03-07 21:59:44 +00:00
telegram fix: forward forceDocument through sendPayload path (follow-up to #45111) (#47119) 2026-03-15 17:23:53 +08:00
test-utils fix(ci): repair helper typing regressions 2026-03-14 03:22:53 +00:00
thread-ownership test: dedupe thread ownership send checks 2026-03-13 23:35:27 +00:00
tlon Tlon: honor explicit empty allowlists and defer cite expansion (#46788) 2026-03-14 23:24:53 -07:00
twitch build: sync plugins for 2026.3.14 2026-03-14 06:05:39 +00:00
vllm build: sync plugins for 2026.3.14 2026-03-14 06:05:39 +00:00
voice-call build: sync plugins for 2026.3.14 2026-03-14 06:05:39 +00:00
whatsapp fix(web): handle 515 Stream Error during WhatsApp QR pairing (#27910) 2026-03-15 17:00:07 +05:30
zalo fix(zalo): use plugin-sdk export for webhook client IP resolution (openclaw#46549) 2026-03-14 18:37:56 -05:00
zalouser fix(zalouser): stop inheriting dm allowlist for groups (#46663) 2026-03-14 19:10:11 -05:00
.npmignore fix: harden windows npm runtime path 2026-03-12 23:03:19 +00:00