fix(whatsapp): send read receipts for inbound messages - #8690
Closed
sgaofen wants to merge 1 commit into
Closed
Conversation
sgaofen
marked this pull request as ready for review
April 13, 2026 00:51
19 tasks
12 tasks
Collaborator
teknium1
reviewed
Jul 12, 2026
teknium1
left a comment
Contributor
There was a problem hiding this comment.
Thanks for isolating the Baileys receipt call and covering its direct success, skip, and rejected-promise behavior. The premise remains valid on current main: accepted ordinary inbound messages are queued at scripts/whatsapp-bridge/bridge.js:750-764 without a readMessages call.
Problems
- Current main now has an additional accepted native poll-update route.
scripts/whatsapp-bridge/bridge.js:650-706queues poll updates and continues before the ordinary-message tail, so the PR's receipt call would not cover poll votes processed by Hermes.
Suggested changes
- Salvage the helper onto current main and invoke it after every accepted enqueue path, including the poll-update enqueue at
scripts/whatsapp-bridge/bridge.js:701. - Make the receipt bounded or non-blocking instead of awaiting an unbounded socket promise in the per-message loop; current outbound Baileys operations use a timeout at
scripts/whatsapp-bridge/bridge.js:136-147. - Add a regression test for the current poll-update path in addition to the helper unit tests.
This is an automated hermes-sweeper review.
| if (messageQueue.length > MAX_QUEUE_SIZE) { | ||
| messageQueue.shift(); | ||
| } | ||
|
|
Contributor
There was a problem hiding this comment.
Please avoid awaiting an unbounded external socket call in the per-message upsert loop. The helper catches rejections but has no timeout, so a pending readMessages call can delay later messages in this batch; make this bounded or deliberately non-blocking.
13 tasks
Collaborator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Root Cause
The native WhatsApp bridge received inbound messages and forwarded them into Hermes, but it never called Baileys' read receipt flow for those messages. As a result, Hermes could respond while WhatsApp still showed the message as unread.
Closes #6055.
Testing
node --check scripts/whatsapp-bridge/bridge.jsnode --check scripts/whatsapp-bridge/read_receipts.jsnode --test scripts/whatsapp-bridge/read_receipts.test.mjs scripts/whatsapp-bridge/allowlist.test.mjsPlatform Tested
Contribution Guide Notes
CONTRIBUTING.mdand checked for existing open PRs before submitting this scoped bug fix.pytest tests/ -qpass unless explicitly noted.