Skip to content

Free, Open Source, Self-Hosted WhatsApp API Gateway

docs(session): name a delete as a writer of desiredState

Yudhi Armyndharis2f720c5da888
diff --git a/docs/05-database-design.md b/docs/05-database-design.md
index cdde675a7..153d798aa 100644
--- a/docs/05-database-design.md
+++ b/docs/05-database-design.md
@@ -346,7 +346,8 @@ CREATE TABLE sessions (
"leaseExpiresAt" TIMESTAMP,
-- 'stopped' after POST /stop or /force-kill, NULL again after an explicit POST /start. Boot
-- auto-start and the takeover sweep skip a stopped row. Server-owned: not in any session
- -- response, only in the /api/infra/export-data backup.
+ -- response, only in the /api/infra/export-data backup. A DELETE writes it too: kept when the
+ -- delete fails part-way or its node dies, taken back when it fails before removing anything.
"desiredState" VARCHAR(20),
"createdAt" TIMESTAMP NOT NULL DEFAULT NOW(),
"updatedAt" TIMESTAMP NOT NULL DEFAULT NOW()
diff --git a/docs/13-horizontal-scaling.md b/docs/13-horizontal-scaling.md
index e2ef0b30c..046d7d8ba 100644
--- a/docs/13-horizontal-scaling.md
+++ b/docs/13-horizontal-scaling.md
@@ -48,8 +48,8 @@
> `qr_ready` row is marked too while it has no phone, since the sweep never adopts a row without one;
> a `qr_ready` row with a phone keeps its status, so the correction never makes it adoptable.
> Nothing else revisits such a row, since the boot reset skips a foreign claim that is still live.
-> A session an operator stopped (`POST /stop` or `/force-kill`) is never adopted, even when its
-> claim did lapse, until an explicit `POST /start`.
+> A session an operator stopped (`POST /stop` or `/force-kill`), or whose `DELETE` failed part-way or
+> died with its node, is never adopted, even when its claim did lapse, until an explicit `POST /start`.
>
> Known limitation: a holder that is alive but cannot reach the database for more than three lease
> TTLs minus one heartbeat (160s at defaults) is marked disconnected by a peer too, and does not write its status back when it reconnects. Its