Skip to content

Free, Open Source, Self-Hosted WhatsApp API Gateway

docs: correct what raising the protocol timeout costs

Yudhi Armyndharis44e8877d31f0
diff --git a/.env.example b/.env.example
index 9a626b6e2..2789916c6 100644
--- a/.env.example
+++ b/.env.example
@@ -132,7 +132,7 @@ STATUS_SEED_ON_READY=false
# (thousands of chats) fails a read with "Runtime.callFunctionOn timed out"; the renderer is still
# working, the command budget just ran out. Must be a POSITIVE integer no greater than 2147483647:
# 0 does not mean "no limit later", it means no timer is armed at all, so a wedged browser holds the
-# request forever instead of failing it as 503; and above 2147483647 Node's timer overflows and
+# request forever instead of failing it; and above 2147483647 Node's timer overflows and
# fires after 1 ms, so the browser never finishes launching. The gateway refuses to boot on either.
# PUPPETEER_PROTOCOL_TIMEOUT_MS=300000
# A freshly linked account is shown a "What's new on WhatsApp Web" modal that must be acknowledged or
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3ee5f60e9..07cce0bfd 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -9,27 +9,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
-- `PUPPETEER_PROTOCOL_TIMEOUT_MS` sets how long a single browser command may take on the
- whatsapp-web.js engine. A read that walks the whole store, such as
- `GET /sessions/{sessionId}/chats` on an account with thousands of chats, can run past Puppeteer's
- budget and fail with `Runtime.callFunctionOn timed out` while the renderer is still working, and
- until now there was no way to raise it short of patching the dependency. Left unset it stays at
- Puppeteer's own budget (180 000 ms today), so an upgrade changes nothing for a deployment that
- does not set it; raise
- it only after seeing that error, since raising it is also how long a wedged browser holds a command
- before the gateway can give up on it. The value must be a positive integer no greater than
- 2 147 483 647, rejected at boot on both ends: Puppeteer only arms its timer for a truthy value, so
- `0` drops the bound instead of raising it and lets a wedged renderer hold the request forever,
- while above 2 147 483 647 Node's timer overflows and fires after 1 ms, so the browser never
- finishes launching.
+- `PUPPETEER_PROTOCOL_TIMEOUT_MS` raises the per-browser-command budget on the whatsapp-web.js
+ engine, for large accounts whose reads fail with `Runtime.callFunctionOn timed out`. Unset keeps
+ Puppeteer's own budget, so nothing changes for a deployment that does not set it. The gateway
+ refuses to boot on `0` or on a value above 2147483647; see docs/12 for when to reach for it.
### Changed
-- The whatsapp-web.js transport classifier now rules out a protocol timeout explicitly. That
- message carries no transport-death signature on the current Puppeteer, so nothing was
- misreporting it and behaviour is unchanged; the point is the spec, which pins the invariant in
- both directions against the message the installed Puppeteer actually throws, so a future bump
- cannot start reading a slow command as a dead page.
+- A whatsapp-web.js protocol timeout is no longer eligible to be classified as a dead page.
+ Behaviour is unchanged on the current Puppeteer; the guard keeps a future bump from reporting a
+ slow command as a transport death.
## [0.23.3] - 2026-08-24
diff --git a/docs/12-troubleshooting-faq.md b/docs/12-troubleshooting-faq.md
index 52f0ea686..33efb3bf3 100644
--- a/docs/12-troubleshooting-faq.md
+++ b/docs/12-troubleshooting-faq.md
@@ -688,13 +688,13 @@ answers `503` and takes the session down with it, and this is just a slow comman
PUPPETEER_PROTOCOL_TIMEOUT_MS=300000
```
-Raise it by as little as the account needs, because the budget is also how long a **wedged** browser
-holds a command before the gateway can give up on it. At 300000 that window is five minutes instead
-of three, and for its duration the stuck command holds the logout fence behind it: `start` and
-`delete` for that session answer `409 SESSION_NAME_TEARDOWN_PENDING`, and `forceKill` refuses with
-`400` because the engine was already evicted. There is no measurement in this repo saying how large
-an account has to be before 180000 is too small, so treat any value above it as an escape hatch you
-reached for after seeing the error above, not as a default worth pre-emptively setting.
+Raise it by as little as the account needs. The budget bounds a command that is slow but still
+running; it is not what protects you from a **wedged** browser. A page that stops answering is
+caught by the liveness watchdog, which probes every 60 s with a 15 s timeout and treats two
+consecutive failures as a disconnect, so a wedge is picked up in roughly 75 to 135 s whatever this
+value is. There is no measurement in this repo saying how large an account has to be before 180000
+is too small, so treat any value above it as an escape hatch you reached for after seeing the error
+above, not as a default worth pre-emptively setting.
> Do not set it to `0`, and do not reach for a row of nines. The gateway refuses to boot on either.
> Puppeteer only arms its timer for a truthy value, so `0` drops the bound altogether and a wedged