-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Description
When a new WhatsApp contact sends their first-ever incoming message to a WAHA session,
two webhook events are delivered instead of one.
Both webhooks describe the same message (payload.id and _data.Info.ID identical),
but have slightly different structures.
Subsequent messages from the same sender behave normally —
the duplication occurs only for the very first incoming message from that contact.
⸻
Version
{
"version": "2025.10.4",
"engine": "GOWS",
"tier": "PLUS"
}
⸻
Steps
To Reproduce
1. Start a fresh WAHA 2025.10.4 (GOWS / PLUS) container with webhook configured.
2. Use a phone number that has never messaged this WhatsApp session before.
3. Send a simple text message, e.g. “hi”.
4. Observe your webhook endpoint logs.
5. Two webhook POSTs arrive with identical payload.id but different internal structure.
⸻
Expected behavior
Only one webhook event should be fired for each unique message.
The “first contact” should behave like any subsequent message.
⸻
Requests - Responses
Both webhook payloads have:
"payload.id": "false_9725XXXXXXX@c.us_A5343E0705E8723F40DD4B1C28517C44",
"payload._data.Info.ID": "A5343E0705E8723F40DD4B1C28517C44"
Differences between the two:
• First event: contains
Message.extendedTextMessage.text and a filled Info.VerifiedName / PushName.
• Second event: contains
Message.conversation and _data.SourceWebMsg, missing VerifiedName and Info.Type.
• Headers differ only in transient Cloudflare fields (cf-ray, x-webhook-request-id, etc.).
• Both originate from the same session, from, and jid.
⸻
Docker Logs
Container logs show two webhook delivered entries for the same message.
No retry or error context, so it is not a resend/retry case.
⸻
Additional context
• Happens only on first message from a new sender, possibly due to initialization or contact verification logic.
• Likely both device-type representations (mobile extendedTextMessage and web conversation) are emitted simultaneously on first contact.
• After the initial message, subsequent ones come cleanly with a single event.
Impact: Downstream automations (e.g. n8n workflows) run twice for the first message from each new user unless filtered manually.
Suggested fix:
• Emit only one consolidated webhook for the first contact.
• Alternatively, mark the duplicate event (e.g. "source": "web-mirror" or "duplicate": true) so clients can ignore it safely.