Skip to content

[NOWEB] Message fails to send to user unless they have messaged me first (ACK error) #2130

Description

@agistarakha

Describe the bug
When attempting to send a WhatsApp message to a new user (one who has never messaged the bot/account before), the message fails to send and returns an ACK error. However, if that same user sends a message to the bot first, the session is successfully established, and the bot is then able to send messages back to them without any issues.

Version
JSON
{
"version": "latest",
"engine": "NOWEB",
"tier": "CORE"
}

Steps
To Reproduce Steps to reproduce the behavior:

Identify a WhatsApp phone number that has no prior chat history with the bot's account.

Send a POST request to /api/sendText targeting that number.

Observe the response and the webhook ack event, which returns an error status.

Now, use that external phone number to send a manual message to the bot.

Send the exact same POST request to /api/sendText from step 2 again.

Observe that the message is now delivered successfully and ACK returns a success status.

Expected behavior
The bot should be able to initiate a conversation and send a message to any valid WhatsApp number, regardless of whether that user has sent a message to the bot earlier.

Requests - Responses
Failed Request (Initial contact):

HTTP
POST /api/sendText
{
"chatId": "628xxxxxxxxxx@c.us",
"text": "Hello from WAHA"
}
Response / Webhook ACK:

Returns an ACK error status (unable to deliver/fail to sync encrypted session).

Successful Request (After user messages the bot):

HTTP
POST /api/sendText
{
"chatId": "628xxxxxxxxxx@c.us",
"text": "Hello from WAHA"
}
Response:

Message sent successfully, ACK transitions to delivered status.

Docker Logs
(Optional: If you have your terminal open, run docker logs right after a failure and paste the error trace here. Look for lines containing NOWEB or session sync errors).

Screenshots
No screenshots attached.

Additional context
This issue is specific to the NOWEB engine. It seems like the engine fails to generate or fetch the necessary pre-keys/session to initiate a secure chat with a completely new contact unless the contact triggers the session handshake first by sending an inbound message.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions