Free, Open Source, Self-Hosted WhatsApp API Gateway
TypeScript apibotgatewayself-hostedwhatsappwhatsapp-apiwhatsapp-automationwhatsapp-botwhatsapp-gatewaywhatsapp-gateway-apiwhatsapp-webwhatsapp-web-api
docs: correct two statements that are not true
Yudhi Armyndharis990c6cbaa2a8
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 1c73adfda..95f59e1cd 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -9,6 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0### Fixed+- **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.++### Fixed+- **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.- **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.- ⚠️ **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`.diff --git a/docs/06-api-specification.md b/docs/06-api-specification.mdindex 2c79114f7..b7e83d124 100644--- a/docs/06-api-specification.md+++ b/docs/06-api-specification.md@@ -3896,7 +3896,7 @@ Webhooks are configured per session and managed under `/api/sessions/:sessionId/Two fields — `secret` and `headers` — are **write-only**: they are accepted on create/update but are **never** returned in any response (the response DTO has no `@Expose` for them, so `fromEntity` drops them). The `secret` is used to compute the `X-OpenWA-Signature: sha256=<hex>` HMAC-SHA256 header on deliveries.-The `events` array accepts these members plus the `*` wildcard: `message.received`, `message.sent`, `message.ack`, `message.failed`, `message.revoked`, `message.reaction`, `message.edited`, `session.status`, `session.qr`, `session.authenticated`, `session.disconnected`, `session.reconnect_loop`, `session.restriction`, `presence.update`, `call.accepted`, `call.rejected`, `call.missed`, `group.join`, `group.leave`, `group.update`, `call.received`, `status.received`. All of them are actively dispatched by the engines.+The `events` array accepts these members plus the `*` wildcard: `message.received`, `message.sent`, `message.ack`, `message.failed`, `message.revoked`, `message.reaction`, `message.edited`, `session.status`, `session.qr`, `session.authenticated`, `session.disconnected`, `session.reconnect_loop`, `session.restriction`, `presence.update`, `call.accepted`, `call.rejected`, `call.missed`, `group.join`, `group.leave`, `group.update`, `call.received`, `status.received`. All of them are actively dispatched by at least one engine — none is a reserved placeholder. Four are **Baileys only**, because whatsapp-web.js produces no callback behind them: `presence.update` (its prerequisite `POST .../presence/subscribe` answers `501` there, so this one announces itself) and `call.accepted` / `call.rejected` / `call.missed` (whatsapp-web.js sees a call ring but never its outcome, so these three are accepted on subscribe and then simply never fire). See the per-event catalog below for engine scope.#### GET /api/sessions/:sessionId/webhooksdiff --git a/src/modules/session/session-proxy.interceptor.ts b/src/modules/session/session-proxy.interceptor.tsindex 4c4d4d932..00dc2eef1 100644--- a/src/modules/session/session-proxy.interceptor.ts+++ b/src/modules/session/session-proxy.interceptor.ts@@ -124,9 +124,15 @@ export class SessionProxyInterceptor implements NestInterceptor {const sessionId = this.sessionIdOf(context, request);if (!sessionId) return next.handle();- // A malformed id cannot name a routed session, and on Postgres a raw findOne against the uuid- // column throws (a 500) before the route's ParseUUIDPipe could answer 400 — skip routing and- // let the pipe reject it.+ // A malformed id cannot name a routed session, so there is nothing to route and the lookup below+ // would be a wasted query — skip it and let the request take its normal 404.+ //+ // NOT because the query would throw: `sessions.id` is `varchar` on BOTH dialects (see the+ // PostgreSQL branch of 1770108659848-AddMessageStatus, and the `gen_random_uuid()::varchar`+ // default a uuid column could not take), so a non-UUID id simply matches nothing. An earlier+ // version of this comment claimed Postgres would raise a 500 here; it would not, and reasoning+ // from that claim leads to conclusions about the 105 unvalidated `@Param('sessionId')` routes+ // that do not hold.if (!isUUID(sessionId)) return next.handle();const owner = await this.sessions.findOne({