fix: Send image/video status#201816
Open
lucianobustos wants to merge 5 commits into
Open
Conversation
…ignature
Sending an image/video status (`sendMessage('status@broadcast', media)`)
crashed with "Cannot read properties of undefined (reading 'id')".
Current WhatsApp Web builds changed `WAWebSendStatusMsgAction
.sendStatusMediaMsgAction` to take a single object
`{ mediaMsgData, beforeSend, funnelContext }` and to require LID
identities, so the previous positional `(msg, mediaUpdate)` call left
`arg.mediaMsgData` undefined. Build the media status message with LID
WIDs (`getMeDeviceLidOrThrow` / `getMaybeMeLidUser`) and call the new
signature. Text status is split out and keeps its existing path; its
`canCheckStatusRankingPosterGating` call is guarded since that helper is
also missing from some builds.
Verified end-to-end on a LID-migrated account: image and video status
now post and render (result `{ messageSendResult: 'OK', msg }`).
Fixes wwebjs#201807
Member
|
Esse código poderia ser bem mais simples |
BenyFilho
requested changes
Jul 3, 2026
Author
|
Great @BenyFilho Is working by removing this too ?? |
Member
Just test it |
BenyFilho
approved these changes
Jul 9, 2026
BenyFilho
requested review from
aliyss,
pedroslopez,
purpshell,
shirser121 and
tuyuribr
July 9, 2026 23:28
aliyss
approved these changes
Jul 19, 2026
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
Posting an image/video status via
client.sendMessage('status@broadcast', media)throws:Text status is unaffected.
Fixes #201807.
Cause
Current WhatsApp Web builds changed
WAWebSendStatusMsgAction.sendStatusMediaMsgAction:{ mediaMsgData, beforeSend, funnelContext }(it readsarg.mediaMsgData.id), so the existing positional call(msg, mediaUpdate)leavesarg.mediaMsgDataundefined→ the crash;@c.us) WIDs are no longer accepted.Separately,
WAWebStatusGatingUtils.canCheckStatusRankingPosterGatingis missing from some builds, so the shared model construction can throw before the send is even reached.Fix
In the
isStatusbranch ofWWebJS.sendMessage:getMeDeviceLidOrThrow()forfrom,getMaybeMeLidUser()forauthor/participant) and call the current signature:sendStatusTextMsgAction(statusOptions)), but thecanCheckStatusRankingPosterGatingcall is guarded with?.() ?? false.Testing
Verified end-to-end on a fully LID-migrated account (whatsapp-web.js 1.34.7):
sendMessage('status@broadcast', <image MessageMedia>, { caption })→ posts and renders as a story; internal result{ messageSendResult: 'OK', msg }.Recipe originally identified by @diun935 in #201807 — thanks!
Notes
Uses stable module IDs (
WAWebSendStatusMsgAction,WAWebUserPrefsMeUser,WAWebMsgKey,WAWebWidFactory), not bundle offsets. Happy to adjust naming/style to match project conventions.