waha icon indicating copy to clipboard operation
waha copied to clipboard

[GOWS] - Duplicate webhook events for first incoming message from new sender (appears twice only on first contact)

Open achiya-automation opened this issue 1 year ago • 12 comments

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": "[email protected]_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.

patron:PLUS

achiya-automation avatar Oct 23 '25 17:10 achiya-automation

still happening in 10.5

patron:PLUS

TareqK avatar Nov 04 '25 10:11 TareqK

+1

mizaelks avatar Nov 08 '25 22:11 mizaelks

+1

jacklc avatar Nov 10 '25 10:11 jacklc

Sigue ocurriendo en la v 2025.11.1 PLUS

davidcotrina686-ops avatar Nov 14 '25 01:11 davidcotrina686-ops

English


Still happening in v 2025.11.1 PLUS

github-actions[bot] avatar Nov 14 '25 01:11 github-actions[bot]

+1

AnxHall avatar Nov 14 '25 13:11 AnxHall

Same here, using global webhook in stack.

mcabral2510 avatar Nov 21 '25 15:11 mcabral2510

+1

mcabral2510 avatar Nov 21 '25 15:11 mcabral2510

Hi, first of all thanks for the great work on WAHA 🙌

We’re seeing similar issue where one incoming WhatsApp message sometimes generates two identical webhooks when using the GOWS engine.

Environment WAHA edition: PLUS Engine: GOWS Version: 2025.11.2 Deployment: Docker

Problem

For some customers, when they send a message (often the first message from that number), WAHA sends two POST requests to our webhook URL. Both requests contain the same message, but with timestamps ~1 second apart.

From our logs:

// Request 1
{
  "payload": {
    "id": "false_13649439626XXXXX@lid_... ",
    "source": "app",
    "body": "مرحباً! هل يمكنني الحصول على مزيد من المعلومات حول هذا؟",
    "from": "13649439626XXXXX@lid",
    "timestamp": 1764608434,
    ...
  }
}

// Request 2 (1 second later)
{
  "payload": {
    "id": "[email protected]_",
    "source": "app",
    "body": "مرحباً! هل يمكنني الحصول على مزيد من المعلومات حول هذا؟",
    "from": "[email protected]",
    "timestamp": 1764608435,
    ...
  }
}

note how the id and from changed.

patron:PLUS

mahmouds12 avatar Dec 02 '25 11:12 mahmouds12

+1

patron:PRO

GoCode-io avatar Dec 03 '25 08:12 GoCode-io

+1

Version 2025.12.1

I've noticed this happening, which ends up generating two conversations in Chatwoot.

Image

patron:PLUS

OrionZap avatar Dec 11 '25 00:12 OrionZap

2025.12.2 - GOWS - fix message duplications - #1718 #1564

patron:PRO

devlikepro avatar Dec 17 '25 11:12 devlikepro

Still happening to me on latest version. 2026.07.01

nicolasvahidzein avatar Aug 23 '26 13:08 nicolasvahidzein