waha icon indicating copy to clipboard operation
waha copied to clipboard

[NOWEB] - GET /api/{session}/channels - Cannot read properties of null (reading 'viewer_metadata')

Open rjarsaniya opened this issue 1 year ago • 15 comments

🐞 Bug Report for WAHA WhatsApp Engine

Describe the bug

When trying to connect to WhatsApp via WAHA, I encountered the following error:

Error: Cannot read properties of null (reading 'viewer_metadata')
    at toChannel (/app/dist/core/engines/noweb/session.noweb.core.js:1192:40)

This happens during the connection attempt, and it prevents the WhatsApp session from being established.


Config

{
 "engine": "NOWEB",
  "tier": "PLUS"
}

Steps

To Reproduce (Sometime) Steps to reproduce the behavior:

  1. Start the WAHA Docker container.
  2. Attempt to connect a WhatsApp account via the Noweb engine.
  3. Observe the crash or error logs.

Expected behavior

I expected the WhatsApp connection to initialize successfully without throwing an error.

rjarsaniya avatar Jul 31 '25 04:07 rjarsaniya

@devlikepro Please take a look at, https://github.com/devlikeapro/waha/blob/core/src/core/engines/noweb/session.noweb.core.ts#L1745-L1749

rjarsaniya avatar Jul 31 '25 04:07 rjarsaniya

The error occurs only if the linked WhatsApp account is a WhatsApp Business account. @devlikepro

rjarsaniya avatar Aug 01 '25 06:08 rjarsaniya

Any update here?

rjarsaniya avatar Aug 01 '25 06:08 rjarsaniya

I don't see the version you're using in the description, could you specify it?

I expected the WhatsApp connection to initialize successfully without throwing an error.

I don't see a place where wecall .toChannel in init. May be you called some API and got this error?

WhatsApp Business account

Do you mean Meta Connected one or regular?

patron:PRO

devlikepro avatar Aug 03 '25 06:08 devlikepro

@devlikepro version: devlikeapro/waha-plus It's a WhatsApp Business account, not a regular WhatsApp account.

rjarsaniya avatar Aug 05 '25 03:08 rjarsaniya

Steps to Reproduce:

  • Connect a WhatsApp Business account by scanning the QR code.
  • Hit the specified endpoint. endpoint: https://waha.devlike.pro/swagger/#/%F0%9F%93%A2%20Channels/ChannelsController_list
  • This will result in an error

rjarsaniya avatar Aug 05 '25 03:08 rjarsaniya

Hit the specified endpoint. endpoint:

That what we need, thank you

patron:PRO

devlikepro avatar Aug 05 '25 07:08 devlikepro

🛠️ Fixes

  • 2025.8.1 - NOWEB - fix channel list - #1177

patron:PRO

devlikepro avatar Aug 05 '25 09:08 devlikepro

@devlikepro The issue persists, could you please review it again?

Cannot read properties of null (reading 'viewer_metadata')

{
    "version": "2025.8.1",
    "engine": "NOWEB",
    "tier": "PLUS"
}

rjarsaniya avatar Aug 28 '25 03:08 rjarsaniya

@rupen-cleverpush the same GET /api/{session}/channels ?

patron:PRO

devlikepro avatar Aug 29 '25 04:08 devlikepro

@rupen-cleverpush the same GET /api/{session}/channels ?

patron:PRO

yes

rjarsaniya avatar Aug 29 '25 04:08 rjarsaniya

We are currently experiencing issues with WhatsApp as well (for some users). Could you please let me know what information you need from my end to investigate this properly

rjarsaniya avatar Sep 15 '25 08:09 rjarsaniya

@devlikepro Do you have any updates on the issue we’re currently facing?

rjarsaniya avatar Sep 29 '25 09:09 rjarsaniya

@rupen-cleverpush if you're talking about channels list - GET /api/{session}/channels - it filters null already, not sure how you got it

https://github.com/devlikeapro/waha/blob/core/src/core/engines/noweb/session.noweb.core.ts#L1784-L1786

patron:PRO

devlikepro avatar Oct 04 '25 07:10 devlikepro

    let channels = newsletters
      .map(toNewsletterMetadata)
      .filter(Boolean)
      .map(this.toChannel);

patron:PRO

devlikepro avatar Oct 04 '25 07:10 devlikepro