-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Description
Is there an existing issue for this?
- I have searched the existing issues.
Is this a problem caused by your code, or is it specifically because of the library?
- I have double-checked my code carefully.
Describe the bug.
In some specific WhatsApp Web clients, the internal module WAWebSetPushnameConnAction is not loaded automatically. It remains undefined until the user interacts with the profile drawer. This causes:
to fail, throwing the error:
and the ready event never fires
Expected Behavior
The ready event should fire, and client.setDisplayName() should change the current user's name
Steps to Reproduce the Bug or Issue
Note that this bug does not affect all clients, only specific ones.
Reproduction Steps:
- Set up an
authStrategy, such asLocalAuth. - Log in to WhatsApp Web (QR Code).
- Stop the program execution.
- Try to connect again.
- The
readyevent is never fired.
additional info:
Using headless: true, wait for WhatsApp Web to load and try running:
window.require('WAWebSetPushnameConnAction').setPushname("Test")Observe the "module not found" error.
Optional: Open the profile drawer. After doing this, the module becomes available and everything works as expected.
WhatsApp Account Type
Standard
Browser Type
Chrome 142.0.7444.134 64 bits
Operation System Type
Linux Kubuntu 25.10
Phone OS Type
Android 15
WhatsApp-Web.js Version
tested on 1.34.2 and latest main
WhatsApp Web Version
2.3000.1030235766
Node.js Version
tested on 18.20.2 and 22.16.0
Authentication Strategy
LocalAuth
Additional Context
No response