[v2.3.7] Groups broken with Chatwoot integration: `No session found to decrypt message` (skmsg, @lid), `formatInternational` TypeError, and group sends from Chatwoot silently dropped

未關閉
#2,755 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 4 天內回覆

還沒有人認領這個 Issue。

評估

難度
5/5
預估耗時
一週以上
新手友好度
15/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
活躍
技術堆疊
docker, postgresql, redis, typescript
領域
api, backend

研究方向

Start with the ChatwootService path that eventWhatsapp takes in the stack traces, where formatInternational is read from an undefined value on fromMe group messages, and with the decryption failure in the Baileys group cipher for @lid participants. Reproduce a group message with addressingMode: "lid" and check whether the group is stored and forwarded. Done means group messages from others and from the phone reach Chatwoot, and a Chatwoot reply is delivered to the group. Check whether PR #2275 is already in the code.

由索引模型根據 Issue 內容生成。

描述

Environment
  • Evolution API: evoapicloud/evolution-api:v2.3.7 (Baileys 7.0.0-rc.9), Docker, PostgreSQL 16 + Redis 7 (AOF)
  • Chatwoot: chatwoot/chatwoot:v4.18.0 (self-hosted), native Evolution ↔ Chatwoot integration
  • Instance: WhatsApp Business number linked via QR (multi-device, the phone stays connected as the primary device)
  • Instance settings: groupsIgnore: false; Chatwoot integration ignoreJids: [], importMessages: true, reopenConversation: true
  • Groups use addressingMode: "lid" (participants arrive as @lid with participantAlt as @s.whatsapp.net)
Summary

Private chats work in both directions (Chatwoot messages get a WhatsApp source_id). Group chats fail in three different ways:

1. Messages from other participants are not decrypted (never reach the DB or Chatwoot)

A text message sent to the group by another participant:

{"level":50,"msg":"failed to decrypt message","messageType":"skmsg","author":"<redacted>@lid",
 "key":{"remoteJid":"<redacted>@g.us","fromMe":false,"participant":"<redacted>@lid",
        "participantAlt":"<redacted>@s.whatsapp.net","addressingMode":"lid"},
 "err":{"type":"Error","message":"No session found to decrypt message",
        "stack":"Error: No session found to decrypt message
    at GroupCipher.decrypt (file:///evolution/node_modules/baileys/lib/Signal/Group/group_cipher.js:35:19)
    at async file:///evolution/node_modules/baileys/lib/Utils/auth-utils.js:220:36"},
 "isSessionRecordError":false}
{"level":50,"error":{},"msg":"transaction failed, rolling back"}

The message is not saved in the Message table and is not forwarded to Chatwoot.

2. Messages sent to the group from the phone (fromMe) crash the Chatwoot service

An image sent to the group from the primary phone (fromMe: true, participant @lid) is stored in Message (status: SERVER_ACK), but the Chatwoot integration throws:

ERROR [ChatwootService] TypeError: Cannot read properties of undefined (reading 'formatInternational')
    at ut.eventWhatsapp (/evolution/dist/main.js:139:2685)
    at async messages.upsert (/evolution/dist/main.js:245:30481)
    at async /evolution/dist/main.js:263:3930

The message never appears in the Chatwoot conversation for that group.

3. Messages sent from Chatwoot to the group are silently dropped

An agent replies (text or image) in the group conversation in Chatwoot. Chatwoot's WebhookJob to /chatwoot/webhook/<instance> completes successfully (~0.5 s, no error), but Evolution logs nothing (LOG_LEVEL=ERROR,WARN,INFO,LOG), nothing is sent to WhatsApp, nothing is stored in Message, and the Chatwoot message stays sent with an empty source_id. The same flow works for private chats.

Steps to reproduce
  1. Connect an instance on v2.3.7 with the Chatwoot integration, groupsIgnore: false and ignoreJids: [].
  2. In a group that uses LID addressing: (a) have another participant send a text, (b) send an image from the primary phone, (c) reply from Chatwoot in the group conversation.
Expected

Group messages are decrypted, forwarded to Chatwoot, and Chatwoot replies are delivered to the group.

Possibly related
  • PR #2275 (Chatwoot/LID robustness, participantAlt guard) — merged into develop; unclear whether it is in v2.3.7 or 2.4.0.
  • Issue #1872 ("[META] @lid vs @jid handling").
  • 2.4.0-rc1 release notes mention LID mapping; 2.4.0-rc2 notes do not mention Chatwoot or groups.

Is this already fixed in 2.4.0-rc2, or is there a recommended way to get the group sender keys re-distributed to the linked device?

主要語言
TypeScript
星號
10.2k
分支
7.5k
平均合併
6 天 19 小時
30 天內合併 PR
4

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

evolution-foundation/evolution-api 的其他 Issue

查看 evolution-foundation/evolution-api 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。