Skip to content

chatwoot integration: Shift+Enter appends a trailing "/" and Enter inserts excessive line spacing #3

Description

@milesibastos

Summary

Multi-line messages composed in Chatwoot arrive corrupted on WhatsApp when the inbox is served
by this Evolution instance:

  • Shift + Enter (soft line break) → the message arrives with a trailing /.
  • Enter → excessive blank spacing between lines.

Reported on tenant mobilemed (Fizzy card evolution-foundation#14, 2026-04-15). Evolution is live for
guandalini, mobilemed, and reali.

Why this is scoped here and not to Chatwoot

Chatwoot's Channel::Api performs no outbound content transformation — the model
(app/models/channel/api.rb) holds only webhook/HMAC configuration and delivers
message.content verbatim to the configured webhook_url. For contrast, Chatwoot does
transform for channels that need it (Channel::Telegram#convert_markdown_to_telegram_html),
and no such method exists for the API channel.

So the content leaves Chatwoot with its original \n line breaks, and the corruption happens
downstream. Starting point: src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts.

Verified by reading chatwoot-app @ 6f3a9c7b9c; re-check if the API channel gains a transform
later.

Steps to reproduce

  1. Open a WhatsApp conversation on a Chatwoot inbox wired to this Evolution instance.
  2. Compose a message with several lines, using Shift + Enter for the breaks.
  3. Send it and read the result on the recipient's WhatsApp.

Acceptance check

A message composed with Shift + Enter arrives on WhatsApp with exactly the line breaks that were
typed, with no trailing / and no inserted blank lines.

Caveat

Reported ~3 months ago. Confirm it still reproduces on the current image before fixing — the
upstream integration has had releases since.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions