fix(client): add fallback for WhatsApp id._serialized renamed to id.$1#201832
fix(client): add fallback for WhatsApp id._serialized renamed to id.$1#201832lindionez wants to merge 2 commits into
Conversation
WhatsApp Web changed the serialized message ID property from _serialized to $1 in its July 2026 update. Any code reading id._serialized received undefined, causing a cascade of TypeError crashes across the entire event pipeline (messages, reactions, polls, media download, quoted messages, etc.). Changes: - Add Base._normalizeId() static helper that copies $1 into _serialized whenever _serialized is missing, keeping all downstream code compatible - Apply Base._normalizeId() to all structure _patch() methods that assign his.id or his.wid: Message, Chat, Contact, Channel, GroupNotification, Broadcast, ClientInfo - Fix GroupNotification chatId and �uthor object reads to use || \ - Fix Message rom, o, �uthor and inviteV4 reads to use || \ - Fix Utils.js browser-side: normalize msg.id in getMessageModel, add || \ fallback to ewMsgKey (fixes sendMessage returning empty), lastReceivedKey, msg.id.remote, chat.id, getMaybeMePnUser(), createWid(p.jid), and userJidToUserWid() calls - Fix Client.js browser-side evaluates: reactions sender, poll vote sender and parentMsgKey, blocked contacts list, lid/phone in getContactLidAndPhone, userJidToUserWid in getCustomerNote, es.gid in �cceptInvite, and participant.wid/createGroupResult.wid in createGroup - Fix GroupChat.js browser-side evaluates: pWid, participant duplicate check, group invite message ID, and lid/phone in emoveParticipants, promoteParticipants, demoteParticipants - Fix Contact.js browser-side: lid in unblock() Closes wwebjs#201829 Co-authored-by: Lindionez <lindionez@users.noreply.github.com> Co-authored-by: Claude <claude@anthropic.com>
|
Working on my side. |
…id._serialized -> id.$1 rename WhatsApp's July 2026 web update renamed message-id's serialized property from _serialized to $1. whatsapp-web.js (still pinned to a pre-fix commit) reads _serialized everywhere, so it silently got undefined - the root cause of sendMessage returning no message object even on a successful send (our earlier @lid workaround was treating a symptom of this, not the actual cause; that workaround stays in place as a harmless safety net). Upstream fix is open as wwebjs/whatsapp-web.js#201832 (closes wwebjs/whatsapp-web.js#201829, #201830) but not yet merged, so pin to the PR author's fork/commit directly until it lands on main. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
WhatsApp Web's July 2026 update renamed the serialized message-ID property
from _serialized to $1. Any code reading id._serialized received undefined,
causing DataError ('get on IDBObjectStore: No key or key range specified')
and cascading failures across media download, getChat, reactions, polls and
quoted messages.
Ports the fix from upstream wwebjs#201832 (by lindionez):
- Base._normalizeId() copies $1 into _serialized when _serialized is missing
- applied in _patch() of Message, Chat, Contact, Channel, Broadcast,
ClientInfo, GroupNotification
- '|| .$1' fallback across Message/GroupChat/GroupNotification and the
browser-side evaluates in Client.js and Utils.js (getMessageModel,
getChatModel, newMsgKey, editMessage, rejectCall, membership requests)
Verified live against WA build 2.3000.1043180520: media download recovered
(getMessageModel id normalized -> resolveMediaBlob returns the JPEG blob).
WhatsApp Web's July 2026 update renamed the serialized message-ID property
from _serialized to $1. Any code reading id._serialized received undefined,
causing DataError ('get on IDBObjectStore: No key or key range specified')
and cascading failures across media download, getChat, reactions, polls and
quoted messages.
Ports the fix from upstream wwebjs#201832 (by lindionez):
- Base._normalizeId() copies $1 into _serialized when _serialized is missing
- applied in _patch() of Message, Chat, Contact, Channel, Broadcast,
ClientInfo, GroupNotification
- '|| .$1' fallback across Message/GroupChat/GroupNotification and the
browser-side evaluates in Client.js and Utils.js (getMessageModel,
getChatModel, newMsgKey, editMessage, rejectCall, membership requests)
Verified live against WA build 2.3000.1043180520: media download recovered
(getMessageModel id normalized -> resolveMediaBlob returns the JPEG blob).
|
Used this one as well. My bot works again. Thanks for the work! |
) merge branch feat/fix-_serialized-id-fallback from lindionez/whatsapp-web.js (upstream PR wwebjs#201832): whatsapp Web (2026-07 update) renamed the _serialized property of id objects to $1; apply the _serialized || $1 fallback across the library and normalize ids at structure boundaries. Conflict resolved in window.WWebJS.sendMessage keeping our sent-message lookup fallbacks, now also $1-aware.
|
Have set this up in my environment will report back in 3-6 hours if it bumps into any issues/side affects. |
apply upstream PR wwebjs#201832 to prevent ExecutionContext destroyed crashes due to the July 2026 update.
|
Problem solved for me. Thank you! |
|
Working on my side. |
|
Thank you, problem solved. |
|
It work for me |
|
Tested. It's working on my side. Thanks! |
…201832) Adiciona Base._normalizeId (copia $1 -> _serialized) nos _patch das estruturas (Message/Chat/Contact/Channel/GroupNotification/Broadcast/ClientInfo) + fallbacks '_serialized || $1' no Client.js e no codigo injetado (Utils.js), incluindo a normalizacao no getMessageModel. Corrige os erros 'r' (TypeError) em getChats, getContactById, getProfilePicUrl, typing e no processamento de mensagens de entrada. Hunk de Contact.find(lid) do upstream nao se aplica (fork usa outro padrao, ja coberto pela normalizacao de this.id).
|
@lindionez Thank you so much! |
|
works for me !! Great Job !!! |
|
@lindionez ⚡️ ⚡️ ⚡️ ⚡️ thanks !!! |
|
Running well since yesterdays comment, nothing bad in the logs! |
beri75
left a comment
There was a problem hiding this comment.
Everything looks good from my review. Thanks!
…#747) WhatsApp Web build 2.3000.x (~2026-07-14) renamed the serialized message-id property `id._serialized` to `id.$1`, breaking whatsapp-web.js 1.34.7's downloadMedia(), message-id extraction, ack tracking, and quoted-message resolution for every bot at once. The production image and source installs now backport upstream fix wwebjs/whatsapp-web.js#201832 (Base._normalizeId) into the dependency at build time. The patcher applies the real upstream diff, fails the build loudly on version skew rather than shipping a partial patch, and auto-disables once a whatsapp-web.js release carries the fix upstream. Stopgap, not a fork — it gets removed with the dep bump. Verified against a live session on an affected build (2.3000.1043250633-alpha): inbound photos download with bytes intact (223KB/1200x1600 and 75KB/1600x900 JPEGs), message ids resolve, the reply endpoint accepts a live quotedMessageId, getChats returns valid ids, and no media-download errors fire. Reactions remain unattributable on these builds — Reaction is the one structure upstream's fix doesn't reach. Reported as wwebjs/whatsapp-web.js#201846 with a fix in wwebjs/whatsapp-web.js#201847; an adapter-side fallback here keeps reaction events from attaching to the wrong message meanwhile. Fixes #747.
|
Thanks for working on this! Just wanted to point out that PR #201848 seems to solve this same issue directly at the root in the Puppeteer injection layer ( |
This PR fixed it for me. |
|
While testing this PR on WhatsApp Web Full environment and reproduction details: #201849 |
|
Thank you for the fix. My bot works again without any changes. |
…rialized renamed to id.$1 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
When this fix will be released officically ? Or it will not ? |
…eado) O fix do PR wwebjs#201832 normalizou $1->_serialized nos structures via _patch(), mas getNumberId retorna o wid CRU do evaluate — sem normalizacao. Com o bundle novo do WA Web, as chaves do retorno de queryWidExists nao sao mais estaveis: result.wid pode vir sob outra chave e o guard `result.wid === undefined` devolvia null -> numero VALIDO era tratado como not_registered. Sintoma em producao (painel Stefani, desde 16/07): enviar para contato NOVO falha com "Number validation failed: not_registered" mesmo o numero tendo WhatsApp; contatos com chat existente (que nao passam por getNumberId) seguem normais. 11 falhas em 2 dias, zero antes de 16/07. Fix: localizar o wid-like no resultado sob QUALQUER chave (shape {server, user}) e retornar objeto plano explicito {server, user, _serialized} normalizado dentro do browser (onde toString ainda existe — a serializacao do evaluate descarta metodos), com fallback _serialized || $1 || user@server.
|
Works for me brother! Thank you. |
|
Confirmed this patch works end-to-end in production against Before the patch: One addition beyond the diff here: we also had to patch Happy to share the exact Utils.js diff we used against 1.34.5-alpha.3 if useful for anyone stuck on an older version. |
|
Works on my side! Until this repository fix officially the problem, I use your solution, @lindionez . |
|
its working! thanks! |
|
Working here too, thank you! |
RCA final: WhatsApp Web renomeou id._serialized -> id.$1 em atualização de julho/2026, quebrando sendMessage() na versão da lib em uso (erro "r: r"). Fix upstream existe (wwebjs/whatsapp-web.js#201832, 4 aprovações, adotado por múltiplos forks independentes) mas ainda não foi mesclado no main oficial. Aplicado como bridge temporário: pin em github:lindionez/whatsapp-web.js #f4ea1e3cf4076e44e36dfe5f81ea57048d2f7761 (commit da própria PR, diff conferido manualmente antes de aplicar). Trocar para o repo oficial assim que a PR mesclar — ver ADR-013 (DOMAIN_INVARIANTS.md) para checklist de retorno e checklist pós-deploy. package-lock.json não pôde ser gerado nesta sessão (sandbox sem acesso à internet) — pendente rodar `npm install` num ambiente com acesso real e commitar o lockfile resultante.
|
Thank you, this fixed it!! My bot is back online. |
WhatsApp Web changed the serialized message ID property from _serialized to $1 in its July 2026 update. Any code reading id._serialized received undefined, causing a cascade of TypeError crashes across the entire event pipeline (messages, reactions, polls, media download, quoted messages, etc.).
Changes:
lastReceivedKey, msg.id.remote, chat.id, getMaybeMePnUser(), createWid(p.jid), and userJidToUserWid() calls
Closes #201829
Closes #201830