Skip to content

Free, Open Source, Self-Hosted WhatsApp API Gateway

docs(baileys): say the no-ids read receipt targets a received message

Yudhi Armyndharis2cd600bdc7a8
diff --git a/docs/06-api-specification.md b/docs/06-api-specification.md
index 1066a54f6..3ee339588 100644
--- a/docs/06-api-specification.md
+++ b/docs/06-api-specification.md
@@ -926,10 +926,10 @@ Mark a chat as read/seen.
**Request body** — `MarkChatReadDto`
-| Field | Type | Required | Constraints | Description |
-| ------------ | -------- | -------- | --------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
-| `chatId` | string | Yes | `@IsString`; `@IsNotEmpty`; `@Matches(/^[^\s@]+@[^\s@]+$/)` (localpart@host, no whitespace) | Engine-native JID, e.g. `[email protected]` (wwebjs) or `[email protected]` (Baileys) |
-| `messageIds` | string[] | No | `@IsArray`; `@ArrayNotEmpty`; `@ArrayMaxSize(100)`; each a non-empty token with no whitespace | Messages to acknowledge. Omit the field to acknowledge only the newest message; an empty array is rejected. |
+| Field | Type | Required | Constraints | Description |
+| ------------ | -------- | -------- | --------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
+| `chatId` | string | Yes | `@IsString`; `@IsNotEmpty`; `@Matches(/^[^\s@]+@[^\s@]+$/)` (localpart@host, no whitespace) | Engine-native JID, e.g. `[email protected]` (wwebjs) or `[email protected]` (Baileys) |
+| `messageIds` | string[] | No | `@IsArray`; `@ArrayNotEmpty`; `@ArrayMaxSize(100)`; each a non-empty token with no whitespace | Messages to acknowledge. Omit the field to acknowledge only the newest received message; an empty array is rejected. |
Baileys acknowledges individual messages rather than chats, and the receipt enumerates ids instead of carrying a read-up-to watermark. Without `messageIds` only the newest received message the engine still holds in memory gets a receipt, so a burst leaves its earlier messages unread and a session restarted since the message arrived has nothing to acknowledge at all. Each supplied id is resolved through the message store, which is what carries the `participant` a group receipt needs. Ignored by whatsapp-web.js, whose own `sendSeen` is chat-level.
diff --git a/docs/29-engine-capability-matrix.md b/docs/29-engine-capability-matrix.md
index 7ec1aec7e..3279f30eb 100644
--- a/docs/29-engine-capability-matrix.md
+++ b/docs/29-engine-capability-matrix.md
@@ -943,11 +943,13 @@ adapter boundary — none silently stubs.
was live-spiked. On wwjs it calls `revokeStatusMessage(statusId)` (own status only).
- **`getContactStatus` / `getContactStatuses` (wwjs).** `Status.type` is the `text|image|video`
union — audio/other story types collapse to `text`.
-- **`archiveChat` / `clearChatMessages` / `deleteChat` / `sendSeen` / `markUnread` (baileys).** All
- five need the chat's last known message: `chatModify` carries it for the first three and for the
- unread mark, and the read receipt is `readMessages([key])`. A chat the session has seen no message
- in resolves `false` rather than throwing, so `POST chats/read` answers `{"success": false}` for a
- chat whatsapp-web.js marks read from the page-side chat object without needing any local history.
+- **`archiveChat` / `clearChatMessages` / `deleteChat` / `sendSeen` / `markUnread` (baileys).** The
+ four `chatModify` actions (archive, clear, delete, unread) need the chat's last known message, which
+ the patch carries. `sendSeen` without message ids is `readMessages([key])` for the newest _received_
+ (not `fromMe`) message, since Baileys drops own keys from a receipt. A chat with no such message
+ resolves `false` rather than throwing, so a chat the session has seen no message in, or one holding
+ only this account's own sends, answers `POST chats/read` with `{"success": false}`, where
+ whatsapp-web.js marks it read from the page-side chat object without needing any local history.
- **`setProfileName` / `setProfilePicture` / `deleteProfilePicture` refusals (baileys).**
whatsapp-web.js reads a page-side verdict for all three (`setDisplayName` and `setProfilePicture`
resolve `false`, `deleteProfilePicture` resolves an explicit `false`) and raises a `403`. The