fix: dual-compat for WA Web 2.3000.1043xxx ($1 vs _serialized, downloadMedia)#201840
Open
erickmourasilva wants to merge 1 commit into
Open
fix: dual-compat for WA Web 2.3000.1043xxx ($1 vs _serialized, downloadMedia)#201840erickmourasilva wants to merge 1 commit into
erickmourasilva wants to merge 1 commit into
Conversation
Keep `_serialized` working for older WhatsApp Web clients and accept `$1` on newer builds. Normalize models returned to Node, dual-read LID/PN and message ids, and fall back to DownloadManager when the in-memory media blob looks incomplete/thumbnail-sized. Co-authored-by: Cursor <cursoragent@cursor.com>
JuancaArg
approved these changes
Jul 15, 2026
|
just heads up that _serialized to $1 rename is causing also msg.react() and msg.reply to fail silently. Adding react and reply fallback in Message.js fixes the issue. These fixes works for me in async react(reaction) in async reply() |
Lewson
added a commit
to Lewson/whatsapp-web.js
that referenced
this pull request
Jul 18, 2026
…0.1043xxx) Adapted from wwebjs upstream PR wwebjs#201840. Fixes media download failing with opaque 'r: r' error after WhatsApp Web renamed id._serialized to $1 and started returning thumbnails from mediaBlob.forceToBlob() in version 2.3000.1043xxx (Jul-2026). - Utils.js resolveMediaBlob: null-safe cache lookup + forceToBlob guard, plus fallback via WAWebDownloadManager.downloadAndMaybeDecrypt when the blob cache is empty or looks like a thumbnail. - Message.js downloadMedia / downloadMediaStream: extract msgId with `this.id._serialized ?? this.id.$1` before passing to evaluate.
3 tasks
3 tasks
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
widSerialized()/normalizeSerialized()so WID/MsgKey work with both_serialized(legacy) and$1(WA Web 2.3000.1043xxx+).getMessageModelandgetChatModel(fixesgetChatById/ typing crashes withr: r).getContactLidAndPhoneand Message_patchfrom/to/author.downloadMedia/downloadMediaStream.resolveMediaBlob, fall back toDownloadManager.downloadAndMaybeDecryptwhen the in-memory blob is missing or looks thumbnail-sized vsmsg.size.Compatibility
_serialized.$1and mirrors onto_serializedfor node-side consumers.Test plan
msg.getChat()/ typing indicator does not throwdownloadMedia()returns full media (bytes ≈msg.size, not thumbnail)getContactLidAndPhonestill returns lid/pn stringsCloses #201831
Made with Cursor