Free, Open Source, Self-Hosted WhatsApp API Gateway
TypeScript apibotgatewayself-hostedwhatsappwhatsapp-apiwhatsapp-automationwhatsapp-botwhatsapp-gatewaywhatsapp-gateway-apiwhatsapp-webwhatsapp-web-api
docs(session): give the real reason start() clamps session.config
Yudhi Armyndharis79219ca4d742
diff --git a/docs/31-session-lifecycle-design.md b/docs/31-session-lifecycle-design.mdindex 18a1b7869..a4e7a551d 100644--- a/docs/31-session-lifecycle-design.md+++ b/docs/31-session-lifecycle-design.md@@ -177,8 +177,9 @@ Collected here so they survive refactors of the code around them:- `session-engine-lifecycle.service.ts` (init deadline region): the do-not-reorder note — theownership re-validation window between the status write and `initialize()` is _narrowed, notclosed_; moving the re-validation after init reopens INV-2.-- `session-engine-controls.ts` (start): `session.config` is clamped to trusted keys because the- row is client-writable; an unclamped spread would let a caller smuggle engine options.+- `session-engine-controls.ts` (start): the reconnect knobs read from the client-writable+ `session.config` are coerced and clamped by `resolveReconnectConfig`, so a poisoned value cannot+ become a NaN delay (a zero-delay relaunch storm) or a NaN attempt cap that never trips.- `EngineRegistry`: identity-based `deleteIfLive` rather than `delete(id)` — see INV-3; everysite that bypassed this in the past created the same phantom-callback bug. The evictionhelpers go through it too: `evictAndForceDestroy`, the init-timeout branch, and `start()`'s catch.