Skip to content

[CW-2823] WhatsApp Interactive Messages with Button Texts Over Limit are Incorrectly Handled #8288

Description

@nathanmoura

Describe the bug

When using the Chatwoot API to send "Options" type interactive messages for a WhatsApp inbox, if the button text exceeds the WhatsApp Cloud API limit of 24 characters, Chatwoot still creates the message in the conversation without returning an error. The HTTP response suggests that the message was successfully created; however, the "successfully sent" icon is not displayed in the conversation, and the recipient does not receive the message. This behavior is misleading because it implies successful message delivery when, in fact, the message was never sent due to the exceeded character limit set by WhatsApp Cloud API.

This issue could lead to confusion for the support agents as they might believe the message was sent successfully when it was not. This validation should probably be dealt with within Chatwoot to maintain message delivery integrity and user expectations.

To Reproduce

Steps to reproduce the behavior:

  1. Set up a WhatsApp type inbox in Chatwoot.
  2. Use the Chatwoot API to send an interactive message with "Options" that include button texts exceeding 24 characters.
  3. Observe that the API response indicates the message was created successfully.
  4. Check the conversation in Chatwoot web app and notice the message appears there.
  5. Observe that the "successfully sent" icon is missing beside the created message.
  6. The client does not receive any message on their end.

Expected behavior

The expected behavior would be for the Chatwoot API to validate the length of the button text against WhatsApp Cloud API's character limit before attempting to send the message. If the button text exceeds the 20-character limit, the API should return an error, and the message should not be created in the conversation within Chatwoot since it violates the constraints of the WhatsApp Cloud API and will not be sent.

Environment

Docker

Cloud Provider

AWS

Platform

Browser

Operating system

No response

Browser and version

No response

Docker (if applicable)

No response

Additional context

I'm running the following image on a Docker Swarm setup: chatwoot/chatwoot:v3.2.0-ce

CW-2823

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething is not working as expected🍛 channel/apiIssues related to API channel💬 channel/whatsappIssues related to WhatsApp channel

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions