Skip to content

Free, Open Source, Self-Hosted WhatsApp API Gateway

docs(changelog): record the Baileys participant refusal mapping

Yudhi Armyndharis733986515c2f
diff --git a/CHANGELOG.md b/CHANGELOG.md
index ca8514ad6..eeaa3f780 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -25,6 +25,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
- Messages that existed before the full-text index was created are indexed on the next boot instead of being permanently unsearchable, and ordinary edits and deletes on them work again. The boot-time backfill was gated on the index being empty, but `messages_fts` is an FTS5 external-content table whose `count(*)` returns the row count of `messages`, so the condition could never hold and the backfill never ran; until those rows are indexed the sync triggers issue delete commands for documents that were never added and SQLite rejects the whole statement. The guard is now a rowid-level completeness check, so it also repairs a partially populated index rather than only an empty one.
+- A WhatsApp-level refusal of a group participant add, remove, promote or demote on the Baileys engine is now reported as `403` instead of propagating as an unhandled error. Participant refusals normally arrive one per participant and were already mapped; a refusal of the request itself arrives through the other channel, and this was the only write in the Baileys group adapter that did not map it. A dropped connection or a timeout is still reported as itself rather than as a permissions problem. Refs #1220.
- Removing, promoting or demoting group participants on the whatsapp-web.js engine now reports which participants WhatsApp actually acted on. The library resolves each requested id against the group's own member list and silently drops what it cannot find, so a request naming only non-members answered `500` for removal — the empty batch tripped an arity assertion — while promotion and demotion answered `200` claiming success for people WhatsApp never touched. Such a request now answers `403`, and a mixed request reports the untouched entries as `404` instead of confirming them. An installation whose `node_modules` predates this release keeps the previous behaviour for the reporting half; the `500` is closed either way. Refs #1220.
- A group participant id that does not name an individual — free text, a group id, a number too short to be one — is now rejected with `400` naming the offending entries, instead of being handed to the engine. On whatsapp-web.js such an id reached the page-side `createWid`, which threw an error the minified bundle reports without a name, so the caller received a `500` that could not be diagnosed from either end. The check covers group creation and adding, removing, promoting and demoting participants, and it sits in the service rather than the request body so the MCP tools are guarded on the same terms as the REST routes. Refs #1220.
- Creating a channel on the Baileys engine no longer answers `500` while leaving the channel behind. The library's response parser read `thread.picture.id` eagerly, but its create call sends only a name and description and has no picture parameter, so the picture was absent on every create and the parse threw after WhatsApp had already created the newsletter — and because the operation is non-idempotent, a client retrying the `500` leaked one orphan channel per attempt, invisible through the API since `getSubscribedChannels` is not available on that engine. A new install-time patch reads the response defensively so the call succeeds and returns the new channel's id, which is the only place that id appears.