Skip to content

The READY event is never triggered due to A/B testing which disables the initial loading of multiple modules #3971

@olob0

Description

@olob0

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:

https://github.com/pedroslopez/whatsapp-web.js/blob/d815847d3e0237854abcdbbc8e9414e9befb26e1/src/util/Injected/Store.js#L114C8-L114C78

to fail, throwing the error:

Image

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:

  1. Set up an authStrategy, such as LocalAuth.
  2. Log in to WhatsApp Web (QR Code).
  3. Stop the program execution.
  4. Try to connect again.
  5. The ready event 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions