waha icon indicating copy to clipboard operation
waha copied to clipboard

[GOWS] - Support Mentions

Open vhiperdev opened this issue 1 year ago • 8 comments

- Mentions Not Working Properly

Describe the bug

The mentions functionality in WAHA is not working correctly. When sending messages with mentions using the official documented format, users do not receive mention notifications in WhatsApp. The issue appears to be that WAHA is not generating the required mentionedJID field in the contextInfo of the message, which is essential for WhatsApp to trigger mention notifications.

Version

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

Steps

To Reproduce Steps to reproduce the behavior:

  1. Send a POST request to /api/sendText with mentions following the official documentation format
  2. Include both @number in the text and the mentions array as documented
  3. Check the resulting message event in WhatsApp
  4. Observe that users mentioned do not receive notification
  5. Analyze the message structure and notice missing mentionedJID in contextInfo

Expected behavior

When sending a message with mentions using the documented format, the system should:

  1. Generate a message with mentionedJID array in the contextInfo
  2. Users mentioned should receive push notifications
  3. The message should appear as a mention in the recipient's chat

Requests - Responses

Request sent (following official documentation):

POST /api/sendText
{
  "session": "default",
  "chatId": "[email protected]",
  "text": "Hi there! @2132132130",
  "mentions": [
    "[email protected]"
  ]
}

Actual Response Event (BROKEN):

{
  "extendedTextMessage": {
    "text": "Hi there! @2132132130",
    "contextInfo": {
      "expiration": 0,
      "disappearingMode": {
        "initiator": 0,
        "trigger": 1,
        "initiatedByMe": false
      }
      // ❌ MISSING: "mentionedJID" field
    }
  }
}

Expected Response Event (WORKING):

{
  "extendedTextMessage": {
    "text": "Hi there! @2132132130",
    "contextInfo": {
      "mentionedJID": [
        "[email protected]"
      ],
      "expiration": 0,
      "disappearingMode": {
        "initiator": 0,
        "trigger": 1,
        "initiatedByMe": false
      }
    }
  }
}

Root Cause Analysis

The issue is that WAHA is not properly converting the mentions array from the request payload into the mentionedJID field in the WhatsApp message contextInfo.

Key findings:

  • The mentions field in the request uses format: ["[email protected]"]
  • WhatsApp requires mentionedJID in format: ["[email protected]"]
  • WAHA is not performing this conversion automatically
  • Without mentionedJID, WhatsApp does not trigger mention notifications

Impact

  • High Priority: Core functionality not working as documented
  • User Experience: Users don't receive mention notifications
  • Documentation: Official examples don't work as expected
  • Engine Affected: GOWS (possibly others)

Suggested Fix

WAHA should automatically:

  1. Parse the mentions array from the request
  2. Convert @c.us format to @s.whatsapp.net format
  3. Add the mentionedJID field to the message contextInfo
  4. Ensure compatibility with WhatsApp's mention notification system

Additional context

  • This affects group messaging functionality significantly
  • The issue is reproducible across different group sizes
  • WEBJS engine handles mentions correctly, suggesting this is GOWS-specific
  • The official documentation format should work without requiring workarounds

Environment:

  • Engine: GOWS
  • Tier: PLUS
  • Version: 2025.8.1
  • Use case: Telegram-WhatsApp bridge with mention forwarding

patron:PLUS

vhiperdev avatar Sep 15 '25 15:09 vhiperdev

+1

patron:PRO

paulobautz avatar Sep 16 '25 00:09 paulobautz

Let's see how many patron:PLUS and patron:PRO supporters needs the feature and prioritize it based on that.

Comment with "+1" if you need it!

devlikepro avatar Sep 16 '25 02:09 devlikepro

+1

patron:PRO

bergpinheiro avatar Sep 23 '25 18:09 bergpinheiro

+1

marcosfnc avatar Sep 23 '25 18:09 marcosfnc

+1

patron:PLUS

johnhenderson avatar Sep 23 '25 18:09 johnhenderson

+1

Julien-hae avatar Nov 03 '25 11:11 Julien-hae

+1

patron:PRO

GoCode-io avatar Nov 03 '25 13:11 GoCode-io

2025.11.1 - GOWS - mentions support - #1372

patron:PRO

devlikepro avatar Nov 07 '25 07:11 devlikepro