Skip to content

fix(wa-2.3000): upstream sync + send-result/media/READY/getChats hardening - #148

Merged
Eonus merged 3 commits into
main-rebasedfrom
chore/upstream-sync-2026-09
Sep 27, 2026
Merged

Eonus merged 3 commits into
main-rebasedfrom
chore/upstream-sync-2026-09

Conversation

@Eonus

@Eonus Eonus commented Sep 27, 2026

Copy link
Copy Markdown
Collaborator

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 $1 fallback patch we have carried since 06ee466 (#143). There were 3 conflicts in Utils.js, all resolved to our side, which is a superset (widSerialized, rebuildKeySerialized, try/catch isolation). After this, main-rebased is 0 behind upstream.

Fixes:

Change Source Why
_serialized getter on WAWebMsgKey.prototype upstream wwebjs#201901 Every page-side key._serialized read works again on 1043xxx+ builds, including sendMessage and editMessage return lookups
sendMessage: set message.id = newMsgKey after all spreads elblogbruno ffc337e mediaOptions.toJSON() can overwrite the key with undefined, which causes "Data passed to getter must include an id"
sendMessage: look up by key, then fall back to the model addAndSendMsgToChat resolved; waitUntilMsgSent rejects on a non-OK send result upstream wwebjs#201933 whats-ts sender.ts reads result.id.id. An undefined return makes a delivered message look failed and triggers a resend, so the recipient gets a duplicate
processMediaData: compute filehash (base64 SHA-256) when media prep leaves it unset elblogbruno 08d3449 Sending documents failed before our existing guard could run
Client: set client.info on every READY elblogbruno fa8809f READY after a re-inject fired with info undefined, and whats-ts reads client.info.wid.user
resolveMediaBlob: stop waiting when mediaStage becomes REUPLOADING upstream wwebjs#201932 With expired media, downloadMedia could wait forever and stall the incoming-message pipeline
getChats/getChannels use Promise.allSettled; ignore a groupMetadata.update DataError and keep the cached metadata upstream wwebjs#201910 / wwebjs#201934 One broken chat (such as an @lid group) no longer fails the whole list

Deliberately left out:

Verification

  • node --check passes on Utils.js and Client.js.
  • Client.js and index.d.ts are prettier-clean for the changed regions.
  • Static only. Nothing has been run against a live WhatsApp session. Before rollout, canary one account and test: text send (result.id is present), image and document send, receiving expired media, getChats on an account with @lid groups, and READY after a reconnect.

whats-ts takes this via github:Eonus21/whatsapp-web.js#main-rebased. Rolling it out needs npm install plus a host-by-host restart.

🤖 Generated with Claude Code

lindionez and others added 3 commits September 26, 2026 15:53
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>
@Eonus
Eonus merged commit ed3f175 into main-rebased Sep 27, 2026
0 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants