Skip to content

fix(groupchat): fix setDescription argument - #201895

Open
pjeuicaro wants to merge 1 commit into
wwebjs:mainfrom
pjeuicaro:fix/setDescription
Open

pjeuicaro wants to merge 1 commit into
wwebjs:mainfrom
pjeuicaro:fix/setDescription

Conversation

@pjeuicaro

Copy link
Copy Markdown

Description

Change setDescription to accept an object instead of positional arguments, making each argument explicit to comply with the new WhatsApp Web version. Fix the error bellow when call setDescription. Await chatWid before passing it to setDescription and use optional chaining when accessing descId to safely handle missing values.

Error [TypeError]: Cannot read properties of undefined (reading 'toJid')g (https://static.whatsapp.net/rsrc.php/v4/y7/r/Pc4nmzfROLz.js:186:118)
Object.b [as widToGroupJid] (https://static.whatsapp.net/rsrc.php/v4/y7/r/Pc4nmzfROLz.js:186:1715) at evaluate (evaluate at GroupChat.setDescription (/home/develop/botwhats/node_modules/whatsapp-web.js/src/structures/GroupChat.js:410:51), <anonymous>:13:25)

I tried to make minimal changes to the current implementation to preserve the existing code pattern.

Previous setDescription(in main)

image

Sugested setDescription

setDescription

Related Issue(s)

  • I couldn't identify an issue with this, but I encountered this error in production. After modifying my base code, the setDescription method ran again without errors.

Testing Summary

Test Details

Environment

  • Machine OS:
    • Ubuntu 24.04.4 LTS
  • Phone OS:
    • Xiaomi Redmi Note 14S
    • HyperOS 3.0.304
    • Android 16BP2A.250606.031.A3
  • Library Version:
    • 1.34.7
  • WhatsApp Web Version:
    • Version 2.3000.1045456189
  • Browser Type and Version:
    • Google Chrome 151.0.7922.137
  • Node Version:
    • Nodejs v25.2.1

Type of Change

  • Dependency change (package changes such as removals, upgrades, or additions)
  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Non-code change (documentation, README, etc.)

Checklist

  • My code follows the style guidelines of this project.
  • All new and existing tests pass (npm test).
  • Typings (e.g. index.d.ts) have been updated if necessary.
  • Usage examples (e.g. example.js) / documentation have been updated if applicable.

change setDescription to accept an object instead of positional arguments,
making each argument explicit to comply with the new WhatsApp Web version.

await chatWid before passing it to setDescription and use optional chaining
when accessing descId to safely handle missing values.
@github-actions github-actions Bot added the api changes API modifications label Aug 18, 2026
rmyndharis added a commit to purnamcommunity/OpenWA that referenced this pull request Sep 1, 2026
The 29.3.1 heading still counted eight patches over a nine row table.

The table row and the patcher header now name the open upstream fix,
wwebjs/whatsapp-web.js#201895, the way the #201832 and #201816 entries
already do, and record what has to survive the day it lands: upstream
keeps WAWebMsgKey.newId() and passes an empty description through
verbatim, so a tree carrying it matches neither the transform's find nor
its replace, and the empty-string clear that docs/06 documents lives
only in the mapping this patcher adds.

Credit the contributor on the CHANGELOG entry, per docs/20.
rmyndharis added a commit to purnamcommunity/OpenWA that referenced this pull request Sep 1, 2026
The 29.3.1 heading still counted eight patches over a nine row table.

The table row and the patcher header now name the open upstream fix,
wwebjs/whatsapp-web.js#201895, the way the #201832 and #201816 entries
already do, and record what has to survive the day it lands: upstream
keeps WAWebMsgKey.newId() and passes an empty description through
verbatim, so a tree carrying it matches neither the transform's find nor
its replace, and the empty-string clear that docs/06 documents lives
only in the mapping this patcher adds.

Credit the contributor on the CHANGELOG entry, per docs/20.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api changes API modifications

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant