Free, Open Source, Self-Hosted WhatsApp API Gateway
TypeScript apibotgatewayself-hostedwhatsappwhatsapp-apiwhatsapp-automationwhatsapp-botwhatsapp-gatewaywhatsapp-gateway-apiwhatsapp-webwhatsapp-web-api
docs(channel): drop an unsupported claim from the channel-admin guard
Yudhi Armyndharis0da20b346c49
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex a0852cff0..4c7d4adfe 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -37,7 +37,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0- Approving or rejecting a join request by bare phone number works on the whatsapp-web.js engine instead of answering `500`: the participant guard accepts a bare number and the three other participant writes qualify it, but these two routes handed it to the engine unqualified, so it reached the page as an unaddressable id. The same request already worked on Baileys. Refs #1220.- A burst of inbound media on the whatsapp-web.js engine no longer loses the media of everything past the eighth, which the Baileys repair in this release left in place on the other engine: its download queue was capped at its active slots too, making admission a constant 8 whatever the batch size. A burst now parks rather than shedding, and only the download waits — a text message never enters the limiter. The wait for a slot is bounded by `MEDIA_DOWNLOAD_TIMEOUT_MS`, so a burst queued behind a hung page still emits its messages without media rather than waiting on a slot that never frees.- A webhook's `filters` is published as nullable, the sibling of the `lastTriggeredAt` repair in this release: the field is stored as `null` for every webhook created without filters and the description offers `null` as an input, but the schema declared neither, so a client generated from the contract rejected a value the route both sends and accepts. An invariant now fails when any property documented as carrying `null` does not publish it.-- The two channel administration routes reject a user id that does not name an individual with `400` instead of handing it to WhatsApp: both bodies accepted any non-empty string, and an id the engine cannot classify was forwarded verbatim, so free text or a group id failed opaquely. A bare phone number is qualified as it is on the group participant writes, and the check sits in the service so the MCP tools are guarded like the REST routes.+- The two channel administration routes reject a user id that does not name an individual with `400` instead of handing it to WhatsApp: both bodies accepted any non-empty string, and an id the engine cannot classify was forwarded verbatim, so free text or a group id failed opaquely. A bare phone number is qualified as it is on the group participant writes, and the check sits in the service rather than the body so it holds for any caller.- The chart's optional ServiceMonitor now selects on a new `openwa.io/scrape-target` label, so it scrapes one target per pod instead of two; series previously collected through the headless target stop appearing, so check anything keyed on the `service` label.- The Helm chart's new startup probe stops the kubelet killing a pod that is still booting, allowing 295s (`periodSeconds: 5`, `failureThreshold: 60`) where the liveness settings allowed 50. It fires immediately, so a fast boot goes live sooner than before, not later — and it is not limited to auto-start, since the database connect retry alone can consume 30 of the old 50 seconds.- A Helm upgrade that changes only `env` or `secretEnv` now restarts the pod through ConfigMap and Secret checksums, so the new configuration reaches the running container. With `existingSecret` set the chart renders no Secret, so that path still needs `kubectl rollout restart`; `values.yaml` notes what publishing the Secret checksum as a pod annotation means.diff --git a/src/modules/channel/channel.service.ts b/src/modules/channel/channel.service.tsindex 2862e1b7d..b4bdc9a7a 100644--- a/src/modules/channel/channel.service.ts+++ b/src/modules/channel/channel.service.ts@@ -63,8 +63,13 @@ export class ChannelService {* Their DTOs only require a non-empty string, and `toEngineJid` passes anything it cannot* classify through verbatim — so free text, a group id or a bare `@c.us` reached the socket and* failed opaquely, while the group participant writes reject the same input with a naming 400.- * Guarded here rather than in the DTO so the MCP tools are covered like the REST routes, which is- * where the group guard sits for the same reason.+ *+ * Guarded here rather than in the DTO to match where the group guard sits, so the rule holds for+ * any caller and not only the HTTP body. Note the group guard's stated reason does NOT carry over+ * verbatim: it covers the agent tools because `AgentToolDeps` injects `GroupService`, and there is+ * no channel tool family — `src/core/agent-tools/tools/index.ts` wires session, message, contact,+ * group, webhook, labels and automation, and nothing else. Today the controller is the only+ * caller; the placement is for the next one.*/private addressableUser(userId: string): string {if (!isAddressableParticipant(userId)) {