fix: WhatsApp id._serialized -> id.$1 rename + @lid getChatById#143
Merged
Conversation
WhatsApp Web's July 2026 update renamed the serialized message/chat ID
property from `id._serialized` to `id.$1`. Any code reading `_serialized`
got `undefined`, cascading into opaque minified TypeErrors ("r: r") across
the event pipeline: media download, reactions, polls, quoted messages, and
sendMessage returning empty.
- Adopt upstream PR wwebjs#201832: add Base._normalizeId()
and `_serialized || $1` fallbacks across structures, Client.js and
Injected/Utils.js. Fixes downloadMedia() "r: r" (issue wwebjs#201833).
- getChat(): resolve @lid ids to the phone-number wid via
WAWebApiContact.getPhoneNumber() before Chat.get/findOrCreateLatestChat,
so @lid chats no longer fail with "No LID for user" (issue wwebjs#201834).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Open
3 tasks
grupokittel-bit
added a commit
to grupokittel-bit/whatsapp-web.js
that referenced
this pull request
Jul 25, 2026
… quebrava downloadMedia()/getChats() (erro minificado 'r: r' em toda midia recebida desde 14/07). Base._normalizeId backfilla _serialized a partir de $1 nos construtores (Message/Chat/Contact/Channel/Broadcast/ClientInfo/GroupNotification) + fallback _serialized||$1 nos reads page-side (Client.js, Injected/Utils.js). Porte manual do PR Eonus21#143 (validado pela comunidade na 1.34.7) pra nossa base 1.34.5-alpha.3; 2 hunks N/A (blocos inexistentes na base). node --check OK nos 11 arquivos. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Problem
WhatsApp Web's July 2026 update renamed the serialized message/chat ID property from
id._serializedtoid.$1. Every code path reading_serializednow getsundefined, cascading into opaque minifiedTypeErrors (r: r,r) across the event pipeline — media download, reactions, poll votes, quoted messages, andsendMessagereturning empty.Fixes the two breakages we hit (mirrors of upstream
wwebjs/whatsapp-web.js):Message.downloadMedia()throws opaquer: rfor all incoming media — upstream issue Message.downloadMedia() throws opaque r: r for all incoming media wwebjs/whatsapp-web.js#201833getChatById()fails 100% for@lidcontacts with "No LID for user" — upstream issue getChatById() fails for 100% of @lid contacts with "No LID for user" — not intermittent, survives full logout + re-pairing wwebjs/whatsapp-web.js#201834Changes
1.
_serialized -> $1fallback (fixes downloadMedia / crash cascade)Faithful adoption of upstream PR wwebjs/whatsapp-web.js#201832 — applied clean, no conflicts:
Base._normalizeId()and apply it to every structure_patch()(Message,Chat,Contact,Channel,Broadcast,GroupNotification,GroupChat,ClientInfo)_serialized || $1fallbacks inClient.js(reactions, poll votes, blocklist,getContactLidAndPhone, customer notes) andInjected/Utils.js(getMessageModelid normalize,newMsgKey,lastReceivedKey,rejectCall, membership requests)2.
@lidgetChatById (fixes "No LID for user") — not in upstream PR, added hereIn
getChat, resolve@lidids to the phone-number wid viaWAWebApiContact.getPhoneNumber()(the accessorgetContactLidAndPhonealready uses, confirmed working in the issue) beforeChat.get/findOrCreateLatestChat, sotoUserLidOrThrowno longer fails and the usync fallback isn't fed a lid number as a phone number.Verification
node --check.@lidguard) should be smoke-tested against a real@lidchat before relying on it.🤖 Generated with Claude Code