Repository navigation
Conversation
WhatsApp is rolling out delivery of contacts' statuses as a top-level <status> stanza instead of <message from="status@broadcast">. Baileys 7.0.0-rc13 has no handler for it, so it is never acked: the server ends the stream ~50 min later (stream:error ack class="status", code 500) and holds back new inbound messages for that session, which then stays "open" but receives nothing. Backport WhiskeySockets/Baileys#2883 via patch-package until it ships in a Baileys release. Fixes evolution-foundation#2778 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
Reviewer's GuideConfigurationAdd a patch-package patch to Baileys that acknowledges top-level status stanzas, including those processed offline.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
1 task done
This branch has not been deployed
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
Fixes #2778.
WhatsApp is gradually rolling out a change that delivers contacts' statuses as a top-level
<status>stanza instead of<message from="status@broadcast">. Baileys7.0.0-rc13(andrc.9, used by 2.3.7 / 2.4.0-rc2) only registers handlers formessage,call,receiptandnotification, so a<status>is never acked.Effects seen in production:
{"tag":"stream:error","content":[{"tag":"ack","attrs":{"class":"status","type":"media",...}}]}(Stream Errored (ack), statusCode 500). Every instance reconnects every ~50 min.<status>waits for its ack, the server holds back new inbound messages for that session. The instance staysopen, sending works, but nothing is received — noMessagerow, nomessages.upsertwebhook. Instance restart and container restart do not fix it; a new QR only helps for a few hours.Fix
Backport of the upstream fix WhiskeySockets/Baileys#2883 through
patch-package(thepatches/directory andpostinstallhook already exist for this):handleStatus, which acks the node via the existingsendMessageAck(the stanza is not decoded);CB:statusthroughprocessNode, and register['status', handleStatus]in the offline node processor so offline<status>nodes are acked in order;onUnexpectedErrorinstead of breaking the offline queue.The patch can be dropped once a Baileys release includes #2883.
Testing
patch-packageapplies cleanly on a fresh install of[email protected]; the module imports fine.rc.9shipped inevoapicloud/evolution-api:2.4.0-rc2) has been running in production on a server with 6 QR instances + Chatwoot:<status>frames logged asunhandledin 5 minutes and no ack;<status>stanzas acked in the first 3 minutes, 0 unhandled, 0 errors; the server released the held-back inbound messages within ~1 minute and the instance kept receiving — no QR re-scan needed.🤖 Generated with Claude Code
Summary by Sourcery
Restore reliable Baileys message reception by acknowledging top-level status stanzas.
Bug Fixes:
Build: