waha icon indicating copy to clipboard operation
waha copied to clipboard

[NOWEB] - Messages dont reach the user device - @lid decode problem

Open diego-goncalves-teixeira opened this issue 4 months ago • 16 comments

I’m facing an issue when trying to send messages to the chatId [email protected]. On the user’s device, WhatsApp shows a notification saying that the message could not be delivered.

For this specific user, the messages don’t reach their device. However, on my own phone, the messages sent through WAHA appear normally. On my phone, I can see the messages I sent via WAHA without any issues. But on the client’s phone, they only see a system message saying that the message could not be delivered.

In the WAHA logs, I only see the status that the message was delivered to the SERVER — I never see a log indicating it was delivered to the DEVICE. Still, if I try to chat with this client directly from my own phone (without WAHA), the conversation works normally.

Version

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

patron:PLUS

Maybe related https://github.com/devlikeapro/waha/issues/1224

patron:PLUS

rafwell avatar Aug 19 '25 16:08 rafwell

+1

HuangDaHui avatar Aug 20 '25 05:08 HuangDaHui

Does the message there have c.us also? LIke if you connect via WAHA and start listening message.any on Dashboard and send a message from the app (not waha) - does the payload have the same jid?

patron:PRO

devlikepro avatar Aug 20 '25 10:08 devlikepro

+1 For me, in some case only works if I send message with chatId = @lid but this option create another chat in my mobile fone.

patron:PLUS

mrbitencourt avatar Aug 20 '25 17:08 mrbitencourt

@devlikepro I just ran the test and yes, the Jid is exactly the same both directly on the phone and through Waha.

WAHA payload: { "id": "evt_01k39crhteqgfqnvjczfj9bzea", "session": "41506b7a-6c8e-4a07-a698-561dcedb0723", "event": "message.any", "payload": { "id": "[email protected]_3EB045949794A5251F4C78", "timestamp": 1755883259, "from": "[email protected]", "fromMe": true, "source": "api", "body": ".", "hasMedia": false, "media": null, "ack": 0, "ackName": "PENDING", "replyTo": null, "_data": { "key": { "remoteJid": "[email protected]", "fromMe": true, "id": "3EB045949794A5251F4C78" }, "message": { "extendedTextMessage": { "text": "." } }, "messageTimestamp": "1755883259", "status": "PENDING" } }, "timestamp": 1755883259726, "metadata": { "connection.uuid": "41506b7a-6c8e-4a07-a698-561dcedb0723", "connection.name": "Suporte", "connection.whatsapp_number": "", "connection.client_id": "2", "store.enabled": "true", "store.fullSync": "true" }, "me": { "id": "[email protected]", "pushName": "Corrija-me - Suporte" }, "engine": "NOWEB", "environment": { "version": "2025.8.1", "engine": "NOWEB", "tier": "PLUS", "browser": null } }

Direct by phone payload:

{ "id": "evt_01k39cr76mzhkghas8qkb2s66b", "session": "41506b7a-6c8e-4a07-a698-561dcedb0723", "event": "message.any", "payload": { "id": "[email protected]_8071376A407E0D0412ADB1A0FA4DF84E", "timestamp": 1755883241, "from": "[email protected]", "fromMe": true, "source": "app", "body": "Ficou alguma dúvida?", "hasMedia": false, "media": null, "ack": 2, "ackName": "DEVICE", "replyTo": null, "_data": { "key": { "remoteJid": "[email protected]", "fromMe": true, "id": "8071376A407E0D0412ADB1A0FA4DF84E" }, "message": {...}, "messageTimestamp": "1755883241", "status": "DELIVERY_ACK", "messageC2STimestamp": "1755883242", "userReceipt": [...], "messageSecret": "+xX7BzwpU+WV6/MZ7GJyaFoupyXewowbslu+Y1CPevc=", "isMentionedInStatus": false } }, "timestamp": 1755883248852, "metadata": { "connection.uuid": "41506b7a-6c8e-4a07-a698-561dcedb0723", "connection.name": "Suporte", "connection.whatsapp_number": "", "connection.client_id": "2", "store.enabled": "true", "store.fullSync": "true" }, "me": { "id": "[email protected]", "pushName": "Corrija-me - Suporte" }, "engine": "NOWEB", "environment": { "version": "2025.8.1", "engine": "NOWEB", "tier": "PLUS", "browser": null } }

patron:PLUS

@devlikepro

I have an update on the case. I ran some tests, and in the situations where the message does not reach my contact, if I use the contact’s @lid to send the message, then the message is delivered correctly. However, if I set @lid as the default chatId for all contacts that have a linked @lid, the service does not work properly, because some contacts who do have a @lid do not receive messages when I use @lid as chatId instead of @c.us.

In the end, I found that sometimes it works to send messages using chatId as lid, and sometimes it works using c.us. The biggest problem is that the API response when sending a message is the same in both cases — so I cannot tell if the contact is actually receiving the message or not by just analyzing the API response. Because of this, I never know when I should use LID or C.US as the chatId.

patron:PLUS

Another detail is that, as the colleague above mentioned, when I start replying using the chatId with @lid, it’s as if it were a different conversation. For example, if I go to Swagger and fetch all the messages by the chatId c.us, it returns the messages exchanged with that chatId. But when I fetch in Swagger the messages exchanged with the @lid, it brings different ones. It almost looks like two separate conversations with the same contact. Do you get what I mean?

patron:PLUS

yeah, it's different chats right now from the storage point, need to work on that! TY for the details, we'll check that

patron:PRO

devlikepro avatar Aug 26 '25 13:08 devlikepro

Hello all

Any updates? I don't know why, but it seems like the number of cases is increasing more than ever, and I'm being pressured by the client.

patron:PLUS

@devlikepro . +1 Facing the same problem

david-yumeru avatar Sep 05 '25 00:09 david-yumeru

@devlikepro

I’ve been investigating this issue to try to find a workaround while it’s not fixed yet. During testing, I found some VERY IMPORTANT information that may be useful for your debugging.

Steps to reproduce the problem

  1. A contact sends me a message.

    • The chatId/from of this contact comes in the format @lid instead @c.us.
    • The message is received normally.
  2. I send a message to the contact using the @c.us.

    • The message is delivered successfully to the contact.
  3. The contact sends a new message in the same conversation.

    • This is where the problem starts.

Observed behavior

From this point on (after we reply and the contact sends another message to continue the conversation), two possible situations occur:

  • Situation 1:
    The conversation keeps working normally.

  • Situation 2 (bug):

    • Sending messages to the @c.us no longer works.
    • If I switch to sending messages using the @lid, the contact starts receiving my messages again.
    • However: in this scenario, the phone that owns the connected number does not receive these messages.
      • On the phone: it’s as if I never sent anything.
      • On WhatsApp Web: the messages appear normally.

patron:PLUS

For anyone facing the same issue, the solution I’ve applied so far is the following:

When the contact has an @lid, I send the message to both @lid and @c.us, and then wait for the delivery receipt to the DEVICE. The chatId that shows the message as delivered is the one I set as preferred, and from then on I send messages only to it.

The beginning of conversations gets a bit messy, but it works as a solution.

patron:PLUS

@devlikepro any updates on this topic?

patron:PLUS

Looking forward to updates!

HuangDaHui avatar Sep 18 '25 05:09 HuangDaHui

@devlikepro is it by any chance the new releases had fixed this problem? i mean, there are some engine updates, not sure what that mean

patron:PLUS

Hi! Try to use the latest NOWEB, it has session migrations for @lid. Kindly test it before production 🙏

patron:PRO

devlikepro avatar Sep 29 '25 05:09 devlikepro