fix(wa-2.3000): upstream sync + send-result/media/READY/getChats hardening - #148
Merged
Merged
Conversation
wwebjs#201832) * fix(client): add fallback for WhatsApp id._serialized renamed to id.$1 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> * Run format --------- Co-authored-by: Lindionez <lindionez@users.noreply.github.com> Co-authored-by: Claude <claude@anthropic.com>
…ed since 06ee466) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…g, getChats isolation - MsgKey.prototype._serialized getter (upstream wwebjs#201901) - sendMessage: pin message.id after spreads; resolve by key, fall back to the addAndSendMsgToChat model; waitUntilMsgSent rejects on non-OK (upstream wwebjs#201933) - processMediaData: compute filehash when prep leaves it unset (elblogbruno 08d3449) - Client: set client.info on every READY, not only first injection (elblogbruno fa8809f) - resolveMediaBlob: stop waiting when media goes REUPLOADING (upstream wwebjs#201932) - getChats/getChannels: Promise.allSettled; tolerate groupMetadata.update DataError (upstream wwebjs#201910/wwebjs#201934) Co-Authored-By: Claude Opus 5.5 (1M context) <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.
Summary
This PR syncs upstream and adds the WA 2.3000.x fixes that have appeared since #147. They come from upstream open PRs (upstream is now
wwebjs/whatsapp-web.js) and from a scan of active forks.Merge of upstream/main (wwebjs#201832). This adds no code. It is the same
$1fallback patch we have carried since06ee466(#143). There were 3 conflicts inUtils.js, all resolved to our side, which is a superset (widSerialized,rebuildKeySerialized, try/catch isolation). After this,main-rebasedis 0 behind upstream.Fixes:
_serializedgetter onWAWebMsgKey.prototypekey._serializedread works again on 1043xxx+ builds, includingsendMessageandeditMessagereturn lookupssendMessage: setmessage.id = newMsgKeyafter all spreadsffc337emediaOptions.toJSON()can overwrite the key withundefined, which causes "Data passed to getter must include an id"sendMessage: look up by key, then fall back to the modeladdAndSendMsgToChatresolved;waitUntilMsgSentrejects on a non-OK send resultsender.tsreadsresult.id.id. Anundefinedreturn makes a delivered message look failed and triggers a resend, so the recipient gets a duplicateprocessMediaData: computefilehash(base64 SHA-256) when media prep leaves it unset08d3449Client: setclient.infoon every READYfa8809finfoundefined, and whats-ts readsclient.info.wid.userresolveMediaBlob: stop waiting whenmediaStagebecomesREUPLOADINGdownloadMediacould wait forever and stall the incoming-message pipelinegetChats/getChannelsusePromise.allSettled; ignore agroupMetadata.updateDataError and keep the cached metadata@lidgroup) no longer fails the whole listDeliberately left out:
@lidMsgKey constructor): it touches the core send path, and nothing in our logs shows we need it.acceptInvite/getInviteCodelazy-loading: whats-ts doesn't call either.Verification
node --checkpasses onUtils.jsandClient.js.Client.jsandindex.d.tsare prettier-clean for the changed regions.result.idis present), image and document send, receiving expired media,getChatson an account with@lidgroups, and READY after a reconnect.whats-ts takes this via
github:Eonus21/whatsapp-web.js#main-rebased. Rolling it out needsnpm installplus a host-by-host restart.🤖 Generated with Claude Code