Skip to content

Free, Open Source, Self-Hosted WhatsApp API Gateway

docs(changelog): condense the 0.14.x release notes to the house length

Yudhi Armyndharisb1f5e772cc5e
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 981ff118e..7fe35f071 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -9,102 +9,133 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
-- **A hundred and twenty-five routes now document a status they could already answer** — the contract described the happy path and the timeout but almost nothing in between: ninety-one routes reach an engine whose `ensureReady()` guard answers `409` when the session has no live engine, and not one of them said so; six sends could answer `400` for a recipient WhatsApp cannot address; six group and channel writes could answer `403` on a WhatsApp-side refusal; eleven routes could answer `404` for a message, group, channel or label that does not resolve; and eleven could answer `501` on the engine that cannot serve them. A client generated from the contract had no branch for any of it, and on the four participant writes the undeclared `403` was the one status separating a refused batch from an applied one.
+- **125 routes now document a status they could already answer** — 91 gained the `409` an unconnected session answers, plus `400` on six sends, `403` on six group and channel writes, `404` on eleven, and `501` on eleven more. A generated client had no branch for any of them.
-- **Five routes now document a `503` they have been answering for releases** — the four group participant writes have spent the shared request budget since 0.14.5 and listing chats by label has answered `503` on a dead whatsapp-web.js page since 0.14.0, but all five published only their success statuses, so a client generated from the contract had no branch for a failure the gateway was already returning; the participant `503` in particular is the one status that separates "WhatsApp never answered" from the per-participant refusals a `200` reports inside `results`.
+- **Five routes now document a `503` they have been answering for releases** — the four group participant writes since 0.14.5, and listing chats by label since 0.14.0. There the `503` is what separates "WhatsApp never answered" from the per-participant refusals a `200` reports inside `results`.
### Fixed
-- **An API key's session allow-list showed ids that can never match** — `allowedSessions` is compared by exact equality against the session id in the request path, but the published example was `['session-uuid-1', 'session-uuid-2']`, so a reader copying its shape would scope a key to nothing and see every request denied; the field now shows real UUIDs and states that names are not accepted, which the MCP tool schema has said all along.
+- **An API key's session allow-list showed ids that can never match** — `allowedSessions` is matched by exact equality against the session id, but the example was `['session-uuid-1', 'session-uuid-2']`, which would scope a key to nothing and deny every request. It now shows real UUIDs.
-- **Seven published examples showed values the API cannot produce** — the session id carried a `sess_` prefix that every session route's `ParseUUIDPipe` rejects before the handler runs, two row ids were UUIDs truncated to `4f1c9b2a-...`, the logout response example omitted `engineLoaded` although its own schema marks it required, the readiness probe keyed its details on `database` where the code writes `mainDatabase` and `dataDatabase`, the engine list advertised a `send-text` capability neither engine declares, and the Baileys-only product send documented the whatsapp-web.js `true_<jid>_<id>` id form that route never returns.
+- **Seven published examples showed values the API cannot produce** — a `sess_`-prefixed session id that `ParseUUIDPipe` rejects, two truncated UUIDs, a logout example missing the required `engineLoaded`, a readiness probe keyed on `database` rather than `mainDatabase`/`dataDatabase`, a `send-text` capability no engine declares, and the whatsapp-web.js id form on a Baileys-only route.
## [0.14.6] - 2026-08-08
### Added
-- **The SDKs can now read and change a running session's config, and read the webhook diagnostics** — `GET`/`PATCH /sessions/{id}/config` (0.14.5's headline feature), the cross-session `GET /webhooks`, and `GET /webhooks/delivery-failures` were absent from all five SDKs while `sdk/README.md` claimed every user-facing resource was exposed; that claim is now scoped to the exclusion list the SDK design doc actually states.
+- **All five SDKs now cover session config and the webhook diagnostics** — `GET`/`PATCH /sessions/{id}/config` (added in 0.14.5), `GET /webhooks` and `GET /webhooks/delivery-failures` were absent; `sdk/README.md` is now scoped to the exclusion list the SDK design doc states.
### Fixed
-- **The Go and Java SDKs can now send the explicit `null` the session-config route needs** — that route takes three states per field (an absent key leaves the value unchanged, `null` clears it to the default, a value sets it), and neither SDK could emit the middle one: Go's `omitempty` omits a nil pointer and Gson drops nulls by default, so restoring `maxReconnectAttempts` to unlimited — the one thing no in-range number can express — was unreachable. Both now carry explicit `clear*` flags.
+- **The Go and Java SDKs can now send the explicit `null` the session-config route needs** — Go's `omitempty` and Gson's default both drop nulls, so restoring `maxReconnectAttempts` to unlimited was unreachable; both now carry explicit `clear*` flags.
-- **Three SDK response types dropped fields the API sends** — the per-participant group result omitted `message`, the product-send response omitted `timestamp`, and Python's new 503 error class was not exported from the package root, so the documented import failed for exactly the class that was added.
+- **Three SDK response types dropped fields the API sends** — the per-participant group result omitted `message`, the product-send response omitted `timestamp`, and Python's new 503 error class was missing from the package root, so its documented import failed.
-- **A running gateway now serves the same schema-valid OpenAPI document as the committed snapshot** — the validity pass was added to the export script only, so `/api/docs` kept serving a document that fails validation while `openapi.json` was clean; a test now holds both producers to the same passes in the same order.
+- **`/api/docs` now serves the same schema-valid document as `openapi.json`** — the validity pass ran in the export script only, so the live document failed validation while the snapshot was clean.
-- **Two statements in the codebase that were not true** — a load-bearing comment justified skipping a lookup on the grounds that PostgreSQL would raise a 500 against a uuid column, when `sessions.id` is `varchar` on both dialects and a malformed id simply matches nothing; and the webhook event table stated all 22 events are actively dispatched by the engines without saying that four of them fire on Baileys only, which the same document states 2 200 lines later.
+- **Two statements in the codebase that were not true** — a comment claimed PostgreSQL would 500 on a malformed id against a uuid column, though `sessions.id` is `varchar` on both dialects; and the webhook event table called all 22 events engine-agnostic when four are Baileys-only.
-- **All five SDKs now give the retryable status a type of its own** — every one classified `401`, `403`, `404`, `409`, `429` and `501` into a dedicated error and let `503` fall through to the base class, which inverted the mapping against usefulness: `501 Not Implemented` is permanent and never worth retrying, while `503` is the transport failure a caller should retry — and 0.14.5 made it the standard answer for "WhatsApp never confirmed" across 47 of the 189 operations.
+- **All five SDKs now give `503` an error type of its own** — `401`, `403`, `404`, `409`, `429` and `501` each had one while `503` fell through to the base class, inverting usefulness: `501` is permanent, while `503` is the retryable answer 0.14.5 made standard across 47 of the 189 operations.
-- ⚠️ **Breaking (SDK types only, no gateway change). Creating a group returns the summary shape, and the SDKs said otherwise** — `POST /groups` answers `{id, name, participantsCount, isAdmin?, linkedParentJID?}`, but the four typed SDKs declared the DETAIL type `get()` returns, so `participants`, `description`, `owner` and `createdAt` were typed as present on a response that never carries them.
+- ⚠️ **Breaking (SDK types only, no gateway change). Creating a group returns the summary shape, and the SDKs said otherwise** — `POST /groups` answers `{id, name, participantsCount, isAdmin?, linkedParentJID?}`, but the four typed SDKs declared the DETAIL type `get()` returns, so `participants`, `description`, `owner` and `createdAt` were typed as present.
-- **Four SDKs could not paginate the session list** — `GET /api/sessions` takes `limit` and `offset`, and only the Go SDK exposed them; the other four sent a bare path and pinned the caller to the server default.
+- **Four SDKs could not paginate the session list** — `GET /api/sessions` takes `limit` and `offset`, and only the Go SDK exposed them; the other four pinned the caller to the server default.
-- **A post-connect group-name hydration WhatsApp never answered no longer finishes without a word** — the read shared the ambiguity `GET /sessions/{id}/groups` was bounded against in 0.14.5, where an unanswered query and an account with no groups both yield an empty result, but only the REST caller got a clock: the hydration step logged neither its success line nor its failure line, so group chats stayed unnamed with nothing to explain it.
+- **A post-connect group-name hydration WhatsApp never answered no longer finishes without a word** — it shared the empty-result ambiguity `GET /sessions/{id}/groups` was bounded against in 0.14.5, but logged neither outcome, so group chats stayed unnamed with nothing to explain it.
-- **The published OpenAPI document is schema-valid again** — `@nestjs/swagger` expands an `@All()` route over its own method list, which includes `search`, and the 3.0 Path Item Object has no field for it, so the ingress route contributed a key that made strict validators reject the whole 150-path document rather than just that route; the export now drops operations the specification cannot express, and nothing in the repository validated the document to catch it.
+- **The published OpenAPI document is schema-valid again** — `@nestjs/swagger` expanded the ingress `@All()` route over `search`, which the 3.0 Path Item Object has no field for, so strict validators rejected the whole 150-path document; the export now drops operations the specification cannot express.
-- ⚠️ **Breaking (SDK types only, no gateway change). Three response shapes the SDKs decoded into the wrong type** — the four group membership writes answer with a per-participant `results` array that a partial refusal is reported in, and all four typed SDKs declared only `{success, message}`, so a rejected member was indistinguishable from a fully applied batch; `ContactRecord` declared `pushname` where both engines emit `pushName` (which left Java's case-sensitive binder returning null for every contact), carried an `isBusiness` the API never sends, and omitted `isBlocked` and `profilePicUrl`; and `send-product` answers with `id` while the SDKs decoded `messageId`.
+- ⚠️ **Breaking (SDK types only, no gateway change). Three response shapes the SDKs decoded into the wrong type** — the four group membership writes return a per-participant `results` array that all four typed SDKs declared as `{success, message}`, hiding partial refusals; `ContactRecord` declared `pushname` for `pushName`, added an `isBusiness` the API never sends and omitted `isBlocked` and `profilePicUrl`; `send-product` answers `id`, not `messageId`.
**Migration.** `addParticipants`/`removeParticipants`/`promoteParticipants`/`demoteParticipants` now return `ParticipantsResult` — a superset of the old type, so existing reads of `success`/`message` keep compiling. `ContactRecord.pushname` becomes `pushName` and `isBusiness` is gone; both were always empty. `sendProduct` returns `ProductMessageResponse { id }`.
-- **A webhook a smart filter drops now leaves a trace** — a condition on a field the event's payload does not carry cannot match, so a `sender` filter suppressed every `message.ack`, `message.failed` and `message.reaction` while the dispatch logged nothing, emitted no metric and recorded nothing in the delivery-failure table, which only tracks deliveries that were attempted; suppression is now logged at debug with the payload fields that were actually available, and the interaction is documented.
+- **A webhook a smart filter drops now leaves a trace** — a `sender` filter silently suppressed every `message.ack`, `message.failed` and `message.reaction`, whose payloads carry no such field; suppression is now logged at debug with the fields that were available, and documented.
-- **Two webhook payload descriptions did not match what is sent** — `session.qr` was documented as carrying the raw QR string when both engines render it to a PNG data URL before the event is dispatched, and the filter field list did not say that its fields exist on only some message events.
+- **Two webhook payload descriptions did not match what is sent** — `session.qr` was documented as carrying the raw QR string when both engines send a PNG data URL, and the filter field list did not say its fields exist on only some message events.
-- **Ten gaps where the published contract described less than the API actually accepts or returns** — eleven operations carried a path template with no parameter to fill it, the plugin upload published no request body at all so the file it exists for was invisible, the statistics window selector was undocumented, the archived-media download and the config-UI route published a `200` with no media type while every sibling binary route declares one, five plugin operations returned a `PluginDto` the contract never named, and six nullable properties published as `type: object` — which also made the ranges declared beside two of them inert, since JSON Schema ignores `minimum`/`maximum` on a non-numeric type.
+- **Ten gaps where the published contract said less than the API accepts or returns** — eleven operations had a path template with no parameter, the plugin upload published no request body, the statistics window selector was undocumented, the archived-media download and config-UI routes published a `200` with no media type, five plugin operations returned an unnamed `PluginDto`, and six nullable properties published as `type: object`, leaving the `minimum`/`maximum` on two of them inert.
## [0.14.5] - 2026-08-08
### Added
-- **Auto-reject calls can be turned on from the dashboard** — the session detail panel now carries a toggle wired to the config endpoint, so the setting no longer requires an API call to reach, and it states that `call.received` still fires and that no restart is needed.
-- **Session config can now be changed without re-linking the account** — `PATCH /api/sessions/{id}/config` sets `autoRejectCalls`, `maxReconnectAttempts` and `reconnectBaseDelay` on a session that is already running, where all three were previously fixed at creation and turning one on meant creating a new session and scanning the QR again.
+- **Auto-reject calls can be turned on from the dashboard** — the session detail panel carries a toggle wired to the config endpoint; `call.received` still fires and no restart is needed.
+
+- **Session config can now be changed without re-linking the account** — `PATCH /api/sessions/{id}/config` sets `autoRejectCalls`, `maxReconnectAttempts` and `reconnectBaseDelay` on a running session; all three were fixed at creation before, so changing one meant another QR scan.
### Fixed
-- **The tests that lock the channel-refusal contract now use a shape the engine can actually produce** — they built the refusal with the numeric code an IQ error carries, which that code path never emits, so they exercised the wrong branch of the classifier and stayed green through a release in which channel refusals regressed from `403` to an opaque `500`.
-- **Four response schemas published values the API cannot emit** — search results documented `direction` as `inbound`/`outbound` while every hit carries `incoming`/`outgoing`, so a client validating against the contract would have rejected all of them; audit entries documented `warning` where the code writes `warn`; the search example named a provider id that does not exist; and the data export omitted `skippedTables` and `omittedInlineMedia` — the two fields that say the archive is truncated. Group detail also advertised a `participantsCount` and an `isAdmin` that only the group LIST returns.
-- **The published image now actually carries the app-state resync fix** — the patcher that bounds the loop was wired into the install hook but never added to the two hand-written lists in the Dockerfile, so it was absent from the production stage, the hook's existence check skipped it without a word, and every image shipped unpatched. It is copied and run fatally now, and a derived check fails the build if a patcher is ever added to one list and not the other.
-- **A channel refusal answers `403` again, not a bare `500`** — narrowing the refusal classifier in the same release fixed the IQ error channel and silently de-classified the other one: WhatsApp's `w:mex` surface reports a refusal as a GraphQL error inside a _successful_ IQ, so it never carries the numeric code the classifier now reads, and deleting or muting a channel the account does not own regressed from `403` to an opaque `500`. The two error channels are decoded separately now; a dead socket and an unanswered query still do not read as refusals.
-- **A profile picture lookup that WhatsApp never answered no longer reads as "this contact has no picture"** — the route answered `200` with `url: null` after a silent minute, which is the same answer a contact without a picture gives, so a caller had no way to tell them apart; it now answers `503`. Passing the engine's own timeout would not have been enough on its own, because the resulting error landed in the catch that produces that same `null`. The batch lookup is unchanged: a per-id failure there is documented as `null` and stays that way.
-- **The last fifteen writes that reported success without confirmation now report it** — the addressbook saves, block and unblock, the archive/unread/clear/delete chat actions, delete-for-me and star, the four label writes and a call rejection all go through an engine call that discards its own result, so each answered `200` whether WhatsApp applied the change or never replied; a rejected call was the sharpest case, since the gateway also published a `rejected` outcome for a rejection nothing had acknowledged. All now share the request budget and answer `503` when no confirmation arrives.
-- **A dead connection is no longer reported as a bad invite code or a permissions refusal** — joining by invite and updating participants both fail without ever entering their `catch`, because the engine resolves an unanswered query rather than rejecting it: the join landed on the same "invite code may be invalid" `400` as a genuinely bad code, and a participant update on the same `403` as a missing admin right. Both now share the request budget and answer `503`; an answered-but-empty result still means what it meant.
-- **Marking a chat read no longer answers a bare `500` when WhatsApp stays silent** — the read receipt reaches a library helper that destructures the query result, so an unanswered one threw a raw `TypeError` that nothing could classify; it now shares the same 30-second budget and answers `503`. The media send path fails the same way and is deliberately left alone: a send is not repeatable, and `503` is a status the SDKs retry, so making it one would trade an opaque failure for duplicate messages.
-- **Channel operations no longer answer a bare `500` when WhatsApp stays silent** — every one goes through a query helper that reports an absent answer as a malformed one, which the refusal classifier cannot place, so the raw error escaped with its message discarded; the channel lookup, invite lookup, subscribe, unsubscribe, delete and mute/unmute now share the same 30-second budget and answer `503`. Creating a channel is deliberately left unbounded for the same reason as creating a group — it is non-idempotent, and `503` is a status the Go SDK retries for `POST`.
-- **The three group-metadata reads no longer answer a bare `500` when WhatsApp stays silent** — `extractGroupMetadata` throws a Boom whose `data` is normalised to null, so the refusal classifier cannot place it and the raw error escaped with its message discarded; `GET /groups/{id}` and `GET /groups/join-info` now spend the same 30-second budget as the rest and answer `503`, and creating a group maps a genuine WhatsApp refusal to `403` instead of the same bare `500`. Group creation is deliberately left unbounded: it is the one non-idempotent call, and `503` is a status the Go SDK retries for `POST`, which could leave duplicate groups behind.
-- **A group list WhatsApp never answered is no longer served as "you are in no groups"** — `groupFetchAllParticipating` fills its result only behind an `if (groupsChild)`, so an unanswered query returns the same empty object an account with no groups produces, and `GET /sessions/{id}/groups` answered `200` with an empty array after a silent minute; there is nothing in the value to tell the two apart, so the read now shares the same 30-second budget as the group writes and answers `503` instead.
+- **The channel-refusal contract tests now use a shape the engine can produce** — built with the numeric code an IQ error carries, which that path never emits, they stayed green while channel refusals regressed from `403` to an opaque `500`.
+
+- **Four response schemas published values the API cannot emit** — search results documented `direction` as `inbound`/`outbound` where hits carry `incoming`/`outgoing`; audit entries `warning` where the code writes `warn`; the search example named a non-existent provider id; the export omitted `skippedTables` and `omittedInlineMedia`; group detail advertised the list-only `participantsCount` and `isAdmin`.
+
+- **The published image now carries the app-state resync fix** — the patcher was wired into the install hook but missing from the Dockerfile's two hand-written lists, so every image shipped unpatched; a derived check now fails the build if the two lists diverge.
+
+- **A channel refusal answers `403` again, not a bare `500`** — the `w:mex` surface reports a refusal inside a successful IQ, so the narrowed classifier missed it and deleting or muting a channel the account does not own regressed.
+
+- **A profile picture lookup WhatsApp never answered no longer reads as "no picture"** — the route answered `200` with `url: null` after a silent minute and now answers `503`; the batch lookup is unchanged, a per-id failure there stays `null`.
+
+- **The last fifteen writes that reported success without confirmation now report it** — the addressbook saves, block/unblock, the archive/unread/clear/delete chat actions, delete-for-me and star, the four label writes and a call rejection all answered `200` whether or not WhatsApp applied the change; each now answers `503`.
+
+- **A dead connection is no longer reported as a bad invite code or a permissions refusal** — joining by invite answered the same `400` as a genuinely bad code and a participant update the same `403` as a missing admin right; both now answer `503`.
+
+- **Marking a chat read no longer answers a bare `500` when WhatsApp stays silent** — an unanswered query threw a raw `TypeError` nothing could classify; it now shares the 30-second budget and answers `503`. The media send path is deliberately unchanged.
+
+- **Channel operations no longer answer a bare `500` when WhatsApp stays silent** — the channel lookup, invite lookup, subscribe, unsubscribe, delete and mute/unmute now share the same 30-second budget and answer `503`; creating a channel stays unbounded, being non-idempotent.
+
+- **The three group-metadata reads no longer answer a bare `500` when WhatsApp stays silent** — `GET /groups/{id}` and `GET /groups/join-info` now spend the same 30-second budget and answer `503`, and creating a group maps a genuine refusal to `403`; group creation stays unbounded for the same reason.
+
+- **A group list WhatsApp never answered is no longer served as an empty list** — an unanswered query and an account with no groups yield the same result, so `GET /sessions/{id}/groups` answered `200` after a silent minute; it now answers `503` on the same 30-second budget.
+
- ⚠️ **Breaking (behavior). A dead socket is no longer reported as a permissions problem** — the helper that decides whether a Baileys failure was a server refusal or a transport death guarded on `data !== undefined`, but Boom's constructor defaults `data` to `null`, so the guard matched every Boom ever thrown and a `Connection Closed` (428) was classified as a 4xx refusal: the group and channel writes that go through that helper answered `403 admin rights or permissions may be missing`, joining by invite answered `400 invalid invite code`, and reading invite info answered `404`, all for a socket that was simply down. Transport failures now propagate as a 5xx instead — **a change of status code on the gateway surface for those cases**. The three profile writes were never affected: they do not go through that helper. The tests that were meant to cover this passed because their fixture was a bare `Error` rather than a real `Boom`, and now use one.
**Migration.** If you branch on the status code from the Baileys group/channel writes, `POST /groups/join`, or `GET /groups/join-info`, a `403`/`400`/`404` there no longer covers the case where the connection was simply down — that now arrives as a 5xx. Treat 5xx as retryable transport failure and keep your existing 4xx handling for genuine refusals; a caller that retried on `403` to work around this should stop, and one that surfaced `400 invalid invite code` to end users will now correctly report an outage instead.
-- **Twelve group and profile writes no longer report success for a change WhatsApp never confirmed** — `groupLeave`, the subject/description/settings/picture/member-add-mode/disappearing-timer writes and the three profile writes all resolve through a Baileys call that awaits its query and then discards the result, and `query()` swallows its own timeout and resolves rather than throwing, so leaving a group you are still in and locking a group that stayed open both answered `200 done`; each now has a deadline of its own and answers `503` when no confirmation arrives, which does mean a genuinely slow write that lands just after the deadline is reported as unconfirmed.
-- **A post-connect app-state resync can no longer spin for the life of the session** — Baileys' `resyncAppState` loops until every collection reports no more patches, but every exit from that loop, including the attempt counter its own comment introduces to "ensure we don't enter a loop that cannot be exited from", sits inside a `for…in` over the decoded patches; an unanswered query decodes to an empty object, so nothing was removed, nothing was counted, and the walk re-asked every sixty seconds until the socket closed. A postinstall patch ends the walk when the decode is empty, and fails the install rather than silently skipping if the upstream shape moves.
-- **A number check no longer answers "not on WhatsApp" when WhatsApp simply did not answer** — Baileys' `onWhatsApp` has no else branch after its result check, so an unanswered lookup resolved `undefined`, which the adapter folded into the same `null` a genuine miss produces; `GET /contacts/check/{number}` then reported `exists: false` and `checkNumberExists` returned false — a confident verdict about a number the gateway had heard nothing about, on the one route the send documentation tells callers to trust before sending. An empty result is still a real answer and still reports `false`; only the absent one now raises `503`.
-- **A group invite code now says why it could not be read** — fetching one is admin-only, but the groups list returns every group the account belongs to whatever its role, so the request lands on ids the caller was just handed: Baileys let WhatsApp's refusal escape as a bare `500` (13 of 16 groups on the test account) while whatsapp-web.js stringified its missing result into `{"inviteCode":"undefined"}` and the link `https://chat.whatsapp.com/undefined` behind a `200` (53 of 101). Both engines now answer `403`, the same status the group writes have answered since they were fixed, and an unanswered query answers `503` instead of the codeless link `https://chat.whatsapp.com/`.
-- **A catalog read no longer stalls for a minute and then reports an empty catalog** — Baileys answers an unanswered query with `undefined` rather than an error and its catalog parsers are null-safe, so a request WhatsApp never replied to was indistinguishable from a business with no products: `GET /catalog` and `/catalog/products` returned `200` with nothing in them after a silent 60 seconds, and `send-product` reported `404 Product not found` for a product it had simply never heard about. The walk now spends one 30-second budget across every page and answers `503`, and a server that repeats a page cursor instead of advancing no longer spins the walk until the process exhausts its heap.
-- **A benign whatsapp-web.js rejection no longer reads like a crash** — the same un-awaited `framenavigated` re-injection that already logs at `WARN` when the page goes away was logged at `ERROR` in its other shape, where the navigation lands before WhatsApp Web has defined its module registry; it appears at the first boot after the pinned WhatsApp Web build moves under a warm profile, and the session reaches ready unaided.
-- **A slow whatsapp-web.js attach is no longer mistaken for a dead one and reloaded out from under itself** — the event-bridge self-heal could fire on the first reconcile tick, two seconds after `authenticated`, but whatsapp-web.js clears `eventsAttached` in its constructor and sets it only once `attachEventListeners` resolves, with `LoadUtils`, a poll of up to thirty seconds for `window.WWebJS`, `ClientInfo` and `InterfaceController` in between, so a false flag is the ordinary reading for most of a minute on a loaded host. The reload then navigated the page out from under the injection still running on it, whose re-entry died at `getWWebVersion` before re-exposing any of the bridge, and the one-shot guard blocked a second attempt, so the session rode out the readiness deadline and was marked failed — credentials kept, but no way back without a restart. The reload now waits out the upstream attach budget first, which still leaves it half the deadline to reinject when one is genuinely warranted.
-
-- **A data export now reports the media it had to leave behind** — an over-budget attachment is replaced with the same omitted marker that media skipped on the way in gets, so a truncated backup was indistinguishable from a complete one both on inspection and on restore; the response now carries `omittedInlineMedia` alongside `skippedTables`, and the dashboard warns after a download that dropped anything.
-- **A node that has observed the loss of its session lease no longer writes `FAILED` for that session** — engine callbacks were fenced only by a local liveness check, so between a heartbeat detecting the loss and the teardown it schedules, a dying generation could park a row a peer already owned in `FAILED`, which is excluded from both the boot reset and the takeover sweep by design and so left the session outside every automatic recovery path on every node until an operator restarted it by hand. The fence engages from the heartbeat tick that detects the loss, not from the moment the lease lapses, so a window remains.
-- **Thirteen settings that did nothing under Docker now take effect** — Compose forwards environment explicitly and has no `env_file`, so `BAILEYS_MARK_ONLINE_ON_CONNECT`, `BAILEYS_SYNC_FULL_HISTORY`, `WEBHOOK_CONTACT_DETAILS`, `ALLOW_UNSIGNED_INGRESS`, `STORE_EPHEMERAL_MESSAGES`, `RESOLVE_LID_TO_PHONE`, `SIMULATE_TYPING`, `MCP_ENABLED`, `SEARCH_ENABLED`, `SERVE_DASHBOARD`, `CACHE_ENABLED`, `DATABASE_LOGGING` and `MAIN_DATABASE_SYNCHRONIZE` never reached the container however the operator's `.env` was written — the MCP server could not be enabled at all, `SEARCH_ENABLED=false` did not disable the search route it documents, and `BAILEYS_MARK_ONLINE_ON_CONNECT` left the paired phone's notifications suppressed for as long as the gateway stayed connected.
+
+- **Twelve group and profile writes no longer report success for a change WhatsApp never confirmed** — `groupLeave`, the subject/description/settings/picture/member-add-mode/disappearing-timer writes and the three profile writes all answered `200 done` whether or not the change landed; each now has a deadline of its own and answers `503`.
+
+- **A post-connect app-state resync can no longer spin for the life of the session** — an unanswered query left Baileys' `resyncAppState` re-asking every sixty seconds until the socket closed; a postinstall patch ends the walk on an empty decode and fails the install if the upstream shape moves.
+
+- **A number check no longer answers "not on WhatsApp" when WhatsApp did not answer** — an unanswered lookup folded into the same `null` a genuine miss produces, so `GET /contacts/check/{number}` reported `exists: false` and `checkNumberExists` returned false; only the absent answer now raises `503`.
+
+- **A group invite code now says why it could not be read** — Baileys let the refusal escape as a bare `500` (13 of 16 groups on the test account) while whatsapp-web.js served `{"inviteCode":"undefined"}` and `https://chat.whatsapp.com/undefined` behind a `200` (53 of 101); both now answer `403`, and an unanswered query `503`.
+
+- **A catalog read no longer stalls and then reports an empty catalog** — `GET /catalog` and `/catalog/products` returned an empty `200` after 60 silent seconds, and `send-product` a `404 Product not found`; the walk now spends one 30-second budget across all pages, answers `503`, and no longer loops on a repeated page cursor.
+
+- **A benign whatsapp-web.js rejection no longer reads like a crash** — the `framenavigated` re-injection logged at `ERROR` in the shape seen at the first boot after the pinned WhatsApp Web build moves under a warm profile; it now logs at `WARN`, and the session reaches ready unaided.
+
+- **A slow whatsapp-web.js attach is no longer mistaken for a dead one** — the event-bridge self-heal could fire two seconds after `authenticated`, though `eventsAttached` stays false for most of a minute; the reload it triggered failed the session, recoverable only by restart. It now waits out the upstream attach budget.
+
+- **A data export now reports the media it had to leave behind** — a truncated backup was indistinguishable from a complete one, on inspection and on restore; the response now carries `omittedInlineMedia` alongside `skippedTables`, and the dashboard warns after a download that dropped anything.
+
+- **A node that has observed the loss of its session lease no longer writes `FAILED`** — a dying generation could park a row a peer already owned in `FAILED`, which both the boot reset and the takeover sweep exclude by design, leaving the session outside every automatic recovery path.
+
+- **Thirteen settings that did nothing under Docker now take effect** — `BAILEYS_MARK_ONLINE_ON_CONNECT`, `BAILEYS_SYNC_FULL_HISTORY`, `WEBHOOK_CONTACT_DETAILS`, `ALLOW_UNSIGNED_INGRESS`, `STORE_EPHEMERAL_MESSAGES`, `RESOLVE_LID_TO_PHONE`, `SIMULATE_TYPING`, `MCP_ENABLED`, `SEARCH_ENABLED`, `SERVE_DASHBOARD`, `CACHE_ENABLED`, `DATABASE_LOGGING` and `MAIN_DATABASE_SYNCHRONIZE` never reached the container: the MCP server could not be enabled, `SEARCH_ENABLED=false` did not disable the search route, and the paired phone's notifications stayed suppressed.
### Changed
-- **Twenty-eight routes now document the `503` they gained in this release, and three document the `501` they always answer on one engine** — every route that reaches an engine call with a request budget can time out, but only ten said so, so a client generated from the contract had no branch for it on the rest and would have reported a gateway fault as an unexpected error; the channel list and channel-message reads refuse on Baileys and subscribe-by-invite refuses on whatsapp-web.js, none of which was stated. The batch avatar lookup's description also said three concurrent engine lookups where the code runs five.
-- **Every remaining module now publishes the shape of what it returns** — health, profile, statistics, media, settings, audit, calls, metrics and search were the last nine with no response schema anywhere, so three quarters of the API had nothing for the contract gate to diff; `/api/metrics` is now typed as the Prometheus text it serves rather than implying JSON, and `PUT /api/settings` keeps no success schema because it always answers 501 by design.
-- **The labels, channels and status endpoints now publish the shape of what they return** — all twenty-four carried a status and a sentence but no schema, so the committed OpenAPI snapshot had nothing to diff for three whole modules; the status media route is now typed as the binary stream it is rather than implying JSON, and a status timestamp is documented as the ISO-8601 string it serialises to rather than the `Date` the engine hands over.
-- **The catalog endpoints now publish the shape of what they return, including one that disagrees with the rest of the API** — `POST /messages/send-product` answers `{id, timestamp}` while every send served by the message module answers `{messageId, timestamp}` for the same value, because this route passes the engine result through unmapped; the schema records the field the code actually sends rather than the one the neighbouring routes use. `send-catalog` is left with no success schema on purpose: no engine can send a catalog link, so a 2xx there would document a response that cannot occur.
-- **The twelve infrastructure endpoints now publish the shape of what they return, and one of them no longer describes the wrong thing** — `GET /infra/storage/export` was documented as a "Tar.gz archive stream" but answers JSON pointing at an archive it wrote under `data/exports/`, so a client following the contract would have waited for a binary body that never comes; the save and restart payloads also now state that a failed config write still answers `200` with `saved: false`, which is the flag a caller has to read.
-- **The ten contacts endpoints now publish the shape of what they return** — they documented a status and a sentence but no schema, so the committed OpenAPI snapshot had nothing to diff for any of them and a change to a response body could reach clients without the contract gate noticing; `GET /contacts/{contactId}/phone` returning `null` for an unresolvable id, and the batch picture lookup answering `null` per id rather than failing, are now stated rather than discovered by calling.
-- **The eighteen group endpoints now publish the shape of what they return** — the whole module documented statuses and prose but not one response schema, so the committed OpenAPI snapshot had nothing to diff for any of it; the per-participant `results` array that an add/remove/promote/demote returns, and the fact that a partial refusal is reported inside a `200` rather than as an error, are now in the contract instead of only in a sentence.
-- **Fourteen more boolean environment variables are now validated at boot** — they are read with a bare `=== 'true'` / `!== 'false'` comparison, so a spelling like `DATABASE_SSL=require` silently configured the opposite of what was asked for; `DATABASE_SSL` in particular read as OFF and sent credentials in plaintext to a server the operator believed was TLS-protected. Only `true`/`false` (or blank) are accepted now, so a deployment using another spelling will fail startup until it is corrected. `MCP_READONLY` and `PUPPETEER_HEADLESS` stay tolerant deliberately — both fail toward the safe state.
-- **The API description now documents the two statuses middleware returns before routing** — `415` for a compressed request body and `503` with `Retry-After` when too much body data is already in flight, neither of which appeared anywhere in the OpenAPI document despite applying to every operation.
-- **The Helm chart now states the reason `replicaCount` must stay 1 that actually applies today** — the warning described two pods corrupting shared session auth, which a session lease and per-pod volumes already prevent, so an operator acting on it would mitigate the wrong thing.
+- **Twenty-eight routes now document their new `503`, and three the `501` they always answer on one engine** — only ten said so before; the channel list and channel-message reads refuse on Baileys, subscribe-by-invite on whatsapp-web.js. The batch avatar lookup also said three concurrent lookups where the code runs five.
+
+- **Every remaining module now publishes its response shapes** — health, profile, statistics, media, settings, audit, calls, metrics and search were the last nine without one, three quarters of the API; `/api/metrics` is now typed as the Prometheus text, and `PUT /api/settings` answers 501 by design and keeps no success schema.
+
+- **The labels, channels and status endpoints now publish their response shapes** — all twenty-four carried a status and a sentence but no schema, leaving three whole modules with nothing to diff; the status media route is now typed as a binary stream and a status timestamp as an ISO-8601 string.
+
+- **The catalog endpoints now publish their response shapes, including one that disagrees with the rest of the API** — `POST /messages/send-product` answers `{id, timestamp}` where every other send answers `{messageId, timestamp}`. `send-catalog` is left with no success schema on purpose: no engine can send a catalog link.
+
+- **The twelve infrastructure endpoints now publish their response shapes, and one is no longer wrong** — `GET /infra/storage/export` was documented as a "Tar.gz archive stream" but answers JSON naming an archive under `data/exports/`; the save and restart payloads now state that a failed config write still answers `200` with `saved: false`.
+
+- **The ten contacts endpoints now publish their response shapes** — none had a schema, so the contract gate had nothing to diff; `GET /contacts/{contactId}/phone` returning `null` for an unresolvable id, and the batch picture lookup answering `null` per id rather than failing, are now stated.
+
+- **The eighteen group endpoints now publish their response shapes** — the module documented statuses and prose but not one schema; the per-participant `results` array an add/remove/promote/demote returns, and the fact that a partial refusal is reported inside a `200`, are now in the contract.
+
+- **Fourteen more boolean environment variables are now validated at boot** — a spelling like `DATABASE_SSL=require` silently configured the opposite, sending credentials in plaintext to a supposedly TLS-protected server; only `true`/`false` or blank are accepted now, so another spelling fails startup. `MCP_READONLY` and `PUPPETEER_HEADLESS` stay tolerant, both failing toward the safe state.
+
+- **The API description now documents the two statuses middleware returns before routing** — `415` for a compressed request body and `503` with `Retry-After` when too much body data is in flight, neither of which appeared in the OpenAPI document despite applying to every operation.
+
+- **The Helm chart now states the reason `replicaCount` must stay 1 that actually applies today** — the warning described two pods corrupting shared session auth, which a session lease and per-pod volumes already prevent.
### Documentation
-- The webhook troubleshooting runbook told operators there was no webhook-delivery log API and to grep container logs instead; that was true when written but `GET /api/webhooks/delivery-failures` shipped four days later, so the one page reached when a webhook is silent denied the endpoint exists. It now carries the real call, names the fields that gate dispatch (`active`, `events`, `filters`), and notes that `lastTriggeredAt` is never set by the Test button.
-- The n8n trigger event table advertised `call.accepted` / `call.rejected` / `call.missed` with no engine caveat, so a whatsapp-web.js user could build a missed-call workflow on events that engine never emits; they are now marked Baileys only, and the troubleshooting section names n8n's test-versus-production webhook URL, which silently delivers a single event and then stops.
+- The webhook troubleshooting runbook denied that a delivery-log API exists and sent operators to grep container logs; `GET /api/webhooks/delivery-failures` shipped four days later. It now carries the real call, names the fields that gate dispatch (`active`, `events`, `filters`), and notes that `lastTriggeredAt` is never set by the Test button.
+
+- The n8n trigger event table advertised `call.accepted`, `call.rejected` and `call.missed` with no engine caveat, so a whatsapp-web.js user could build a workflow on events that engine never emits; they are now marked Baileys only, and the troubleshooting section names n8n's test-versus-production webhook URL, which delivers one event then stops.
## [0.14.4] - 2026-08-07
@@ -118,28 +149,28 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
-- **A WhatsApp-initiated unlink now leaves a durable audit record** — the disconnect reason previously reached only the log, the webhook and the socket, so once the process restarted an unlink was indistinguishable over the API from an ordinary network drop; transient drops stay unaudited, so a reconnect storm still writes nothing.
-- **The Go SDK has its first semantic version, `sdk/go/v0.2.0`** — until now the module proxy only served pseudo-versions, so callers could not pin a release at all.
+- **A WhatsApp-initiated unlink now leaves a durable audit record** — the reason reached only the log, the webhook and the socket, so after a restart an unlink was indistinguishable from a network drop; transient drops stay unaudited.
+- **The Go SDK has its first semantic version, `sdk/go/v0.2.0`** — the module proxy served only pseudo-versions, so callers could not pin a release.
- **`rmyndharis-openwa` 0.2.0 on PyPI** — the first release through the trusted-publishing workflow, carrying everything the Python SDK gained since 0.1.0 in June.
- **`rmyndharis/openwa` 0.2.0 on Packagist** — the first versioned PHP release since June; Composer users on a stable constraint were pinned to 0.1.0 while only `dev-main` moved.
### Changed
-- **An API request body with a `Content-Encoding` other than `identity` is now refused with `415`** — the aggregate in-flight body cap counts wire bytes, so a compressed body was admitted on its compressed size and then inflated past the memory it was supposed to bound.
+- **An API request body with a `Content-Encoding` other than `identity` is now refused with `415`** — the in-flight body cap counts wire bytes, so a compressed body was admitted small and inflated past that bound.
### Fixed
-- **A reconnect now force-kills a wedged browser before relaunching** — when a Chromium that stopped responding also refused to shut down, the automatic reconnect launched its replacement against the same browser profile while the old process could still be holding it, so the retry could fail on the very condition it was recovering from.
-- **Saving the Infrastructure page no longer overwrites a saved engine with the one an environment variable pins** — the engine radio seeded from the running engine even when `ENGINE_TYPE` pinned it, so saving any field on that page persisted the pinned value into `data/.env.generated` and unsetting the variable could no longer restore the engine the operator had chosen.
-- **A WhatsApp-initiated unlink now clears a session's stored credentials once rather than twice** — whatsapp-web.js can raise the logout event more than once for a single unlink and nothing deduplicated it, so the repeats raced each other and a still-open browser into the `ENOTEMPTY` failure the removal now carries the retry budget to survive.
-- **A reaction to a message the gateway never stored no longer vanishes** — the `message.reaction` webhook and the dashboard stream were both gated on the stored row, so a reaction to an ephemeral message, or to one that arrived before the session went live, was dropped with no error and no log.
-- **`MEDIA_DOWNLOAD_ENABLED` is now validated at boot** — it is read as "anything that is not `false`/`0`/`no`", so a typo left inbound media being decrypted and base64-inlined into every message row instead of disabling it. Only `true`/`false`/`1`/`0`/`yes`/`no` are accepted now, so a spelling like `on` that used to work will fail startup until it is changed.
-- **A data export now bounds the inline media it carries** — base64 inflates a single 50 MiB attachment to 66 MiB, past the import's own 25mb request-body limit, so a backup could export cleanly and then be refused with `413` on restore. `EXPORT_INLINE_MEDIA_BUDGET_BYTES` (8 MiB by default) caps the total across messages and bulk batches, spending it newest-first within each table and serving messages before batches, and an over-budget message payload exports as the omitted marker while a bulk-batch entry simply loses its `base64`; a URL-referenced payload is never dropped whatever the case of its scheme, and a large enough text-only history can still exceed the limit.
-- **A data import now carries each session's ownership lease by its remaining time instead of its original deadline** — a restore re-applied the deadline unchanged, so one that ran longer than a claim had left committed that claim as expired, including claims held by other nodes whose engines never stopped.
-- **A refused data import no longer offers a retry that stops live engines** — the one refusal whose retry is destructive now carries `IMPORT_WOULD_ORPHAN_ENGINES` and the dashboard matches it positively, so a refusal that only asks the operator to wait can no longer present a confirm whose OK re-runs the replace-all with `stopOrphans=true`.
-- **A data import is refused with `409` when another transaction holds the connection** — on SQLite it would otherwise nest inside that transaction and commit into it rather than to disk, so a restore reported as successful could vanish with that transaction's rollback.
-- **A second data import while one is running is now refused with `409`** — on SQLite both shared a single transaction, so the second one's rollback discarded a restore the first had already reported as successful.
-- **A replace-all data import no longer disturbs the engines it left running** — the restore dropped each session's ownership lease and, on SQLite, the heartbeat could read the half-applied transaction, so a renewal concluded the claim was lost and tore down engines that had never stopped.
+- **A reconnect now force-kills a wedged browser before relaunching** — an unresponsive Chromium could still hold the profile, so the relaunch failed on the very condition it was recovering from.
+- **Saving the Infrastructure page no longer overwrites a saved engine with an environment-pinned one** — the engine radio seeded from the running engine, so saving any field wrote `ENGINE_TYPE`'s value into `data/.env.generated` and unsetting the variable no longer restored the operator's choice.
+- **A WhatsApp-initiated unlink now clears a session's stored credentials once rather than twice** — whatsapp-web.js can raise the logout event more than once, so the repeats raced each other and a still-open browser into `ENOTEMPTY`; the removal now carries a retry budget.
+- **A reaction to an unstored message no longer vanishes** — the `message.reaction` webhook and the dashboard stream were gated on the stored row, so a reaction to an ephemeral or pre-session message was dropped with no error or log.
+- **`MEDIA_DOWNLOAD_ENABLED` is now validated at boot** — it was read as anything other than `false`/`0`/`no`, so a typo left inbound media base64-inlined into every message row. Only `true`/`false`/`1`/`0`/`yes`/`no` are accepted; a spelling like `on` now fails startup.
+- **A data export now bounds the inline media it carries** — base64 inflates a 50 MiB attachment to 66 MiB, past the import's 25mb body limit, so a backup could export cleanly and fail `413` on restore. `EXPORT_INLINE_MEDIA_BUDGET_BYTES` (8 MiB by default) caps the total across messages and bulk batches.
+- **A data import now carries each session's ownership lease by remaining time, not original deadline** — a restore running longer than a claim had left committed it as expired, including claims held by other nodes whose engines never stopped.
+- **A refused data import no longer offers a retry that stops live engines** — only the destructive refusal carries `IMPORT_WOULD_ORPHAN_ENGINES`, which the dashboard now matches positively, so a wait-and-retry refusal cannot offer a confirm that re-runs with `stopOrphans=true`.
+- **A data import is refused with `409` when another transaction holds the connection** — on SQLite it nested inside that transaction, so a restore reported as successful vanished with that transaction's rollback.
+- **A second data import while one is running is now refused with `409`** — on SQLite both shared a single transaction, so the second's rollback discarded a restore the first had reported as successful.
+- **A replace-all data import no longer disturbs the engines it left running** — the restore dropped each session's ownership lease and, on SQLite, the heartbeat could read the half-applied transaction, so a renewal tore down engines that had never stopped.
## [0.14.2] - 2026-08-06
@@ -175,59 +206,103 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
-- **Autoreply rules** — per-session single-message autoreplies under `/api/sessions/:id/automation-rules`; conditions use the webhook filter format, the reply goes through the normal send path, and `fromMe`/freshness/per-chat-cooldown guards bound reply loops.
+- **Autoreply rules** — per-session single-message autoreplies under `/api/sessions/:id/automation-rules`; conditions use the webhook filter format, and `fromMe`/freshness/per-chat-cooldown guards bound reply loops.
+
- **Message & chat management** — pin/unpin and star/unstar messages, archive/unarchive chats, clear a chat without deleting it, and vote on polls (whatsapp-web.js).
+
- **Contacts, groups & channels** — save/edit/remove addressbook contacts; read/set/remove a group picture; `memberAddMode` group setting; preview a group from its invite code before joining; create/delete/mute channels.
+
- **Labels** — create, rename, recolour and delete labels; eight label agent tools for MCP (four read-only, four write).
+
- **Presence & calls** — subscribe to presence (`presence.update`, online/typing) and receive call-outcome events (`call.accepted`, `call.rejected`, `call.missed`).
+
- **Send options** — `linkPreview` toggle on `send-text`, plus a caller-supplied `customLinkPreview` on Baileys.
+
- **Media & status** — server-side media conversion (audio→Ogg/Opus, video→MP4) via `ffmpeg` (`MEDIA_CONVERSION_ENABLED`); post an audio status as a voice note; archive chat media to the file store and fetch it back after delivery (`CHAT_MEDIA_ARCHIVE_ENABLED`).
+
- **Opt-in send pacing** (`SEND_PACING_ENABLED`) — warm-up ramp, daily caps, a failure breaker, and a cold-reachout budget that also bounds group participant adds; enforcement is recorded in the audit log.
+
- **Account restrictions surfaced** — WhatsApp-imposed restrictions appear on the session (API + `session.restriction` webhook + dashboard badge) instead of a generic error.
-- **SDK coverage for the new surface** — the JavaScript, Python, Go, Java and PHP SDKs all gained this release's new calls: pin/star a message, poll voting, archive and clear a chat, labels, channels, presence subscription, group picture / join-info / member-add mode, addressbook contacts, server-side media conversion and voice status. Autoreply rules are REST-only for now.
-- **Horizontal-scaling groundwork (opt-in)** — sessions record their owning process via a renewed lease so two replicas cannot both start one; a node only reaps the in-flight bulk batches of sessions it may claim, and a data import reports the sessions another node is running; a dead node's sessions are adopted automatically once the lease lapses (`SESSION_TAKEOVER_SWEEP_MS`); session-scoped requests are forwarded to the owning node when each node sets `NODE_URL`; and WebSocket events fan out across replicas when `REDIS_ENABLED=true`.
+
+- **SDK coverage for the new surface** — the JavaScript, Python, Go, Java and PHP SDKs gained this release's new calls: pin/star, poll voting, archive and clear a chat, labels, channels, presence subscription, group picture / join-info / member-add mode, addressbook contacts, media conversion and voice status. Autoreply rules stay REST-only.
+
+- **Horizontal-scaling groundwork (opt-in)** — a renewed lease records a session's owner so two replicas cannot both start it; dead nodes' sessions are adopted once it lapses (`SESSION_TAKEOVER_SWEEP_MS`); bulk reaping and data import respect peers' claims; session-scoped requests forward to the owner when every node sets `NODE_URL`; and WebSocket events fan out across replicas under `REDIS_ENABLED=true`.
### Changed
- Built under the full TypeScript `strict` family, with per-module test-coverage floors across the codebase.
-- The official Docker image now installs `ffmpeg` (~210 MB larger, measured with `--no-install-recommends`). It backs the opt-in media-conversion endpoints and is installed unconditionally, so the binary is present even though `MEDIA_CONVERSION_ENABLED` still defaults to off. It is the Debian package rather than a bundled static build so codec CVEs arrive through the same security stream as the rest of the image.
-- `session.restriction` is now socket-subscribable as well as webhook-delivered, and the dashboard session card picks up a restriction (or its lift) live instead of only on a page reload.
-- ⚠️ **Breaking (behavior).** Eager status backfill on session ready is now opt-in (`STATUS_SEED_ON_READY`, default off): the immediate `status@broadcast` read could make some freshly paired whatsapp-web.js accounts lose the companion at WhatsApp Web's first scheduled reload. Statuses posted before a session connects are therefore no longer backfilled unless you set `STATUS_SEED_ON_READY=true`; live status events are unaffected either way. Thanks @duckvhuynh.
-- ⚠️ **Breaking (behavior).** Link previews are opt-in on the Baileys engine. Sends carrying a URL previously produced a preview card because the engine's own generator ran by default; they now go out without one unless the request passes `linkPreview: true` (or a `customLinkPreview`). This restores the documented engine default and removes a blocking outbound fetch from every URL-bearing send — which cost a bulk campaign minutes — but recipients of an unchanged integration will see plain links where a preview card used to appear.
+
+- The official Docker image now installs `ffmpeg` (~210 MB larger, measured with `--no-install-recommends`) unconditionally, so the binary is present even though `MEDIA_CONVERSION_ENABLED` still defaults to off; it is the Debian package, not a static build, so codec CVEs arrive through the image's usual security stream.
+
+- `session.restriction` is now socket-subscribable as well as webhook-delivered, and the dashboard session card picks up a restriction or its lift live instead of only on a page reload.
+
+- ⚠️ **Breaking (behavior).** Eager status backfill on session ready is now opt-in (`STATUS_SEED_ON_READY`, default off): the immediate `status@broadcast` read could make freshly paired whatsapp-web.js accounts lose the companion. Statuses posted before a session connects are no longer backfilled unless you set `STATUS_SEED_ON_READY=true`; live status events are unaffected. Thanks @duckvhuynh.
+
+- ⚠️ **Breaking (behavior).** Link previews are opt-in on the Baileys engine. A send carrying a URL now goes out without a preview card unless it passes `linkPreview: true` (or a `customLinkPreview`), restoring the documented engine default; unchanged integrations show plain links where a card used to appear.
### Fixed
-- **Status posting on the whatsapp-web.js engine** — current WhatsApp Web had broken text and media status outright; the postinstall patcher restores both. Text, image, video and voice status post again.
-- **whatsapp-web.js sessions could report "ready" with a dead inbound pipeline** after a warm restart, silently dropping incoming messages. The adapter now refuses to promote a session whose event bridge never attached, reloading the page once and failing loudly (keeping credentials) if it stays dead.
+- **Status posting on the whatsapp-web.js engine** — current WhatsApp Web had broken text and media status outright; the postinstall patcher restores both, so text, image, video and voice status post again.
+
+- **whatsapp-web.js sessions could report "ready" with a dead inbound pipeline** after a warm restart, silently dropping incoming messages. A session whose event bridge never attached is no longer promoted: the page reloads once, then the start fails loudly, keeping credentials.
+
- **Baileys delete-chat, mark-unread and delete-for-me silently did nothing on individual (1:1) chats** — the neutral id was not folded to the engine form used as the app-state key.
+
- **Voice notes on the Baileys engine now carry a waveform.**
+
- The webhook producer enqueues idempotently, and the bundled Redis is pinned `--maxmemory-policy noeviction` so queued jobs are not silently dropped.
+
- A media-storage root the app cannot write to is caught at boot with a clear error, instead of failing on the first write (#1066).
-- The `postinstall` hook no longer aborts with `EALLOWSCRIPTS` under npm 11 when the user's `.npmrc` sets `allow-scripts=true`: npm exports that as `npm_config_allow_scripts`, which npm 11 refuses in the nested dashboard install. The hook now strips it from the environment passed to each nested step. Thanks @configurowebmax.
-- The bundled `docker-compose.yml` now forwards the `SEND_PACING_*`, `MEDIA_CONVERSION_*`/`FFMPEG_PATH` and session-ownership (`NODE_ID`, `NODE_URL`, lease/sweep) variables — previously these features could not be enabled from `.env` in a compose deployment at all.
-- The four label write tools (`LabelUpsert`, `LabelDelete`, `LabelAddToChat`, `LabelRemoveFromChat`) answered `Internal error` over MCP even though the write had succeeded on WhatsApp, prompting agents to retry a completed operation; they now return `{ success: true }`.
-- **Boot validation covers the lease and routing knobs.** A heartbeat that is not comfortably under half the lease TTL (renewals landing after the claim lapsed, so peers adopt sessions from a healthy node), a `NODE_URL` that is scheme-less or carries embedded credentials, a non-integer `AUTOMATION_MAX_PER_SESSION`, and a non-positive media-conversion knob are now boot errors instead of silent fallbacks or a 500 on the first forward. Forwarded responses also relay the owner's `Retry-After`/`X-RateLimit-*`, and an unusable owner URL answers 503 rather than 500.
-- **Autoreply rules gain a per-session cap** (`AUTOMATION_MAX_PER_SESSION`, default 32, `0` = unlimited), mirroring the webhook fan-out cap's shape (`WEBHOOK_MAX_PER_SESSION`, default 16): every inbound message is evaluated against every rule of its session.
-- The cold-reachout probe recognises a bare phone number, so a known contact passed without a JID suffix is no longer charged as a stranger; a voice status accepts `backgroundColor`; and a graceful shutdown no longer logs a handful of Redis unsubscribe errors.
-- **Security (multi-node routing only): the session forwarder could be aimed at any origin.** HTTP/1.1's absolute-form request target (`GET http://elsewhere/api/sessions/x`) is matched by the router and left verbatim in the request URL, where resolving it against the owner's address discards that address — an authenticated caller could make a node forward their request, API key attached, to an origin of their choosing and read the response. The forward target is now rebuilt from the owner's origin plus the request's path and query, so the destination cannot be influenced at all. Deployments without `NODE_URL` (the default) were never affected: the forwarder is inert there.
-- **`stop` and `delete` are fenced against a session a live peer is running.** Only `start` was claim-checked, and neither of those two needs a local engine, so a request landing on the wrong node — routine when session ownership is configured but request routing is not — wrote `disconnected` over a peer's live session or deleted its row and credentials while the peer's engine kept running. Both now answer 409; a lapsed claim still proceeds, since taking over is what the claim rule allows.
-- **Multi-node ownership races closed:** a `stop` landing while a `start` is mid-launch no longer hands back the claim under a live engine (which left the engine unclaimed and startable a second time elsewhere), a failed start no longer pins its session to that node forever, and a deliberate teardown of a session whose crashed owner's lease had lapsed now really leaves it down instead of being re-adopted by the takeover sweep. Successful forwarded requests also stop logging a spurious error.
-- **The send breaker only counts failures that reached WhatsApp.** Client-fault and engine-state errors raised inside the send call — a blocked media URL, a capability the engine lacks, a disconnected socket, a malformed status post — no longer accumulate toward it, so a client sending bad requests can no longer 429 every send on a healthy session for the cooldown. Applied to single sends, bulk batches and status posts alike.
-- **`send-sticker` with a video mimetype works in the official image.** whatsapp-web.js converts video to animated WebP through `ffmpeg`, which the image did not ship, so a documented-as-supported call always failed there; the image now carries the binary.
-- **Backup/restore covers `automation_rules`.** The table was in neither the export nor the import while the restore's session wipe cascade-deletes it, so a documented backup→restore silently destroyed every autoreply rule.
-- Media conversion answers 400 (not 500) for a blocked, unreachable or oversized input URL; `POST /api/sessions/:sessionId/channels/:channelId/mute` refuses a non-channel id instead of muting an ordinary chat forever; listing a label's chats and previewing an unknown group invite answer 404 instead of 500 on whatsapp-web.js; a refused disappearing-message change answers 403; voice-status media is served as audio rather than octet-stream; `PUT /labels/:id` treats explicit `null` fields as an empty body; and an addressbook write with a bare phone number is qualified before it reaches Baileys.
-- **Small correctness batch:** the cold-reachout history probe matches both user-id spellings (a known contact addressed the other way no longer reads as cold), an expired account-restriction stops badging the session, ending a ringing call clears its live handle, `PUT /labels/:id` refuses an empty body, addressbook writes refuse group/newsletter/broadcast ids (not just `@lid`), and the channel endpoints' OpenAPI docs state the real 403 refusal status instead of 422.
-- **SDKs:** the Go SDK encodes a nil poll-vote `options` as `[]` (clearing a vote now works from the zero value), the Java `GroupSettings` and `SendVoiceStatusRequest` records keep back-compat constructors after gaining a field, and all five SDKs expose the voice-status `backgroundColor` the server accepts.
-- The dashboard status viewer now plays a voice status with an audio player instead of rendering it as a broken image, the JS SDK's `StatusRecord.type` includes `'voice'`, and the SDK README's method tables and three misplaced doc comments were brought back in line with the actual surface.
-- Fetching a status's media that S3 retention already removed answers 404 instead of 500 (the local-storage miss already did), and server-side media conversion is bounded to `MEDIA_CONVERSION_CONCURRENCY` (default 2) concurrent `ffmpeg` processes with a short queue — saturation answers 503 instead of stacking processes.
-- **Baileys message-action targeting:** star/pin/unpin/react/delete now verify the stored message belongs to the requested chat (a mismatched pair answered success while writing under the wrong conversation), pin/unpin/react/delete resolve LID-migrated contacts like every other send, and tagging/untagging a chat's label folds the neutral id to the engine form so the write lands on the real chat instead of a phantom index.
-- **whatsapp-web.js raw-id extraction hardening:** every raw WhatsApp Web id is now read through one helper that accepts the renamed property, so a minified WA Web build no longer breaks id-bearing reads. Listing a label's chats no longer 500s when a labelled chat was deleted; the channel list, channel creation and group-invite preview stop returning ids as the literal string `"undefined"` or turning a valid invite preview into a false 404; the number-registration check (`GET /api/sessions/:sessionId/contacts/check/:number`) stops reporting every number as unregistered; and group participants, the group owner and the "am I admin" comparison resolve again instead of yielding `"undefined"` ids.
-- **Baileys refusals now answer their documented statuses instead of 500:** an invalid/expired group invite previews as 404, admin-refused group writes (subject, description, announce/locked, picture, member-add mode) and refused channel writes (create/delete/mute) answer 403 — matching the whatsapp-web.js engine. Transport failures still propagate unchanged.
-- **Multi-node request routing hardening:** forwarded requests now carry the client address in `x-forwarded-for` (so `allowedIps` keys and per-IP throttling see the real client once peer nodes are listed in `TRUSTED_PROXIES`), a malformed session id no longer 500s on Postgres in routed mode, and the client-settable forwarded marker is verified — a marked request landing on a live non-owner answers 409 instead of executing there.
-- **Send pacing accounting:** forwards now pass through the cold-reachout gate (they were ungated while still draining the budget), replying to someone who wrote first today no longer spends the cold budget, and a pacing 429 inside a bulk batch is recorded as `SEND_PACING_LIMITED` instead of a generic `SEND_FAILED`.
-- **Multi-node: a session claim could outlive its engine and pin the session to one node forever.** A failed start, a logout, a force-kill or an exhausted reconnect kept the ownership claim, and the heartbeat renewed it indefinitely — the session could not be started on any peer and the takeover sweep never saw it. Claims are now released on every teardown path, and the heartbeat only renews claims that still cover a live engine, an in-flight start or a pending reconnect. Starting a nonexistent session also answers 404 again instead of a misleading 409 "running on another node".
+
+- The `postinstall` hook no longer aborts with `EALLOWSCRIPTS` under npm 11 when the user's `.npmrc` sets `allow-scripts=true`; the exported `npm_config_allow_scripts` is now stripped from each nested step's environment. Thanks @configurowebmax.
+
+- The bundled `docker-compose.yml` now forwards the `SEND_PACING_*`, `MEDIA_CONVERSION_*`/`FFMPEG_PATH` and session-ownership (`NODE_ID`, `NODE_URL`, lease/sweep) variables, which previously could not be enabled from `.env` in a compose deployment at all.
+
+- The four label write tools (`LabelUpsert`, `LabelDelete`, `LabelAddToChat`, `LabelRemoveFromChat`) answered `Internal error` over MCP after a successful write, prompting agents to retry a completed operation; they now return `{ success: true }`.
+
+- **Boot validation covers the lease and routing knobs.** A heartbeat not comfortably under half the lease TTL, a `NODE_URL` that is scheme-less or carries embedded credentials, a non-integer `AUTOMATION_MAX_PER_SESSION` and a non-positive media-conversion knob are now boot errors. Forwarded responses relay the owner's `Retry-After`/`X-RateLimit-*`, and an unusable owner URL answers 503 rather than 500.
+
+- **Autoreply rules gain a per-session cap** (`AUTOMATION_MAX_PER_SESSION`, default 32, `0` = unlimited), mirroring the webhook fan-out cap (`WEBHOOK_MAX_PER_SESSION`, default 16); every inbound message is evaluated against every rule of its session.
+
+- The cold-reachout probe recognises a bare phone number, so a known contact without a JID suffix is no longer charged as a stranger; a voice status accepts `backgroundColor`; and a graceful shutdown no longer logs Redis unsubscribe errors.
+
+- **Security (multi-node routing only): the session forwarder could be aimed at any origin.** An absolute-form request target survived into the forward, so an authenticated caller could redirect it, API key attached, to any origin. The target is now rebuilt from the owner's origin plus the path and query; deployments without `NODE_URL` (the default) were unaffected.
+
+- **`stop` and `delete` are now fenced against a live peer's session.** Only `start` was claim-checked, so a request landing on the wrong node could write `disconnected` over a peer's live session or delete its row and credentials; both now answer 409, while a lapsed claim still proceeds.
+
+- **Multi-node ownership races closed:** a `stop` mid-`start` no longer hands the claim back under a live engine, a failed start no longer pins its session to that node, and a teardown after the owner's lease lapsed now stays down instead of being re-adopted by the takeover sweep. Successful forwarded requests stop logging a spurious error.
+
+- **The send breaker only counts failures that reached WhatsApp.** Client-fault and engine-state errors raised inside the send call no longer accumulate toward it, so bad requests can no longer 429 every send on a healthy session; applied to single sends, bulk batches and status posts alike.
+
+- **`send-sticker` with a video mimetype works in the official image.** whatsapp-web.js converts video to animated WebP through `ffmpeg`, which the image did not ship; the image now carries the binary.
+
+- **Backup/restore covers `automation_rules`.** The table was in neither the export nor the import while the restore's session wipe cascade-deletes it, so a backup→restore silently destroyed every autoreply rule.
+
+- Media conversion answers 400, not 500, for a blocked, unreachable or oversized input URL; `POST /api/sessions/:sessionId/channels/:channelId/mute` refuses a non-channel id; listing a label's chats and previewing an unknown group invite answer 404, not 500, on whatsapp-web.js; a refused disappearing-message change answers 403; voice-status media is served as audio, not octet-stream; `PUT /labels/:id` treats explicit `null` fields as an empty body; and addressbook writes qualify a bare phone number before it reaches Baileys.
+
+- **Small correctness batch:** the cold-reachout history probe matches both user-id spellings, an expired account restriction stops badging the session, ending a ringing call clears its live handle, `PUT /labels/:id` refuses an empty body, addressbook writes refuse group/newsletter/broadcast ids (not just `@lid`), and the channel endpoints' OpenAPI docs state 403 for a refusal, not 422.
+
+- **SDKs:** the Go SDK encodes a nil poll-vote `options` as `[]`, so clearing a vote works from the zero value; the Java `GroupSettings` and `SendVoiceStatusRequest` records keep back-compat constructors after gaining a field; and all five SDKs expose the voice-status `backgroundColor`.
+
+- The dashboard status viewer plays a voice status with an audio player instead of a broken image, the JS SDK's `StatusRecord.type` includes `'voice'`, and the SDK README's method tables and three misplaced doc comments match the actual surface again.
+
+- Fetching a status's media that S3 retention already removed answers 404 instead of 500, matching the local-storage miss; server-side media conversion is bounded to `MEDIA_CONVERSION_CONCURRENCY` (default 2) concurrent `ffmpeg` processes with a short queue, and saturation answers 503.
+
+- **Baileys message-action targeting:** star/pin/unpin/react/delete now verify the stored message belongs to the requested chat — a mismatched pair previously answered success while writing under the wrong conversation. Pin/unpin/react/delete also resolve LID-migrated contacts, and tagging/untagging a chat's label folds the neutral id to the engine form.
+
+- **whatsapp-web.js raw-id extraction hardening:** every raw id now goes through one helper that accepts the renamed property, so a minified WA Web build no longer breaks id-bearing reads. Listing a label's chats no longer 500s when a labelled chat was deleted; the channel list, channel creation and group-invite preview stop returning `"undefined"` ids or a false 404 on a valid invite; the number-registration check (`GET /api/sessions/:sessionId/contacts/check/:number`) stops reporting every number as unregistered; and group participants, the group owner and the "am I admin" comparison resolve again.
+
+- **Baileys refusals answer their documented statuses instead of 500:** an invalid or expired group invite previews as 404, and admin-refused group writes (subject, description, announce/locked, picture, member-add mode) and refused channel writes (create/delete/mute) answer 403, matching whatsapp-web.js. Transport failures still propagate unchanged.
+
+- **Multi-node request routing hardening:** forwarded requests carry the client address in `x-forwarded-for`, so `allowedIps` and per-IP throttling see the real client once peer nodes are listed in `TRUSTED_PROXIES`; a malformed session id no longer 500s on Postgres in routed mode; and a marked request landing on a live non-owner answers 409 instead of executing there.
+
+- **Send pacing accounting:** forwards now pass through the cold-reachout gate (they drained the budget while ungated), replying to someone who wrote first today no longer spends the cold budget, and a pacing 429 inside a bulk batch is recorded as `SEND_PACING_LIMITED` rather than `SEND_FAILED`.
+
+- **Multi-node: a session claim could outlive its engine.** A failed start, logout, force-kill or exhausted reconnect kept the claim alive, pinning the session to one node forever. Claims are now released on every teardown path and renewed only while an engine, start or reconnect is live; starting a nonexistent session answers 404 instead of 409.
+
- Corrected column names in `docs/05-database-design.md`.
-- Documentation refresh: capability-matrix and MCP tool counts, the `sessions` ownership columns and the `automation_rules` table in the database doc (both now covered by the schema-accuracy gate), the socket-subscribable event list, and precise wording for send-pacing scope and failover engine-overlap.
+
+- Documentation refresh: capability-matrix and MCP tool counts, the `sessions` ownership columns and the `automation_rules` table in the database doc (both now covered by the schema-accuracy gate), the socket-subscribable event list, and the wording for send-pacing scope and failover engine-overlap.
### Security