[BAILEYS][Chatwoot App] readMessages on @lid chats routes to WEBJS getChat -> 500, blocks outbound send
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 45/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Tranquilla
- Stack tecnologico
- node.js, typescript
Direzione di ricerca
Start by tracing ChatWootInboxMessageCreatedConsumer in message_created.js, where readMessages runs before sendText, then follow the session implementation selected for the BAILEYS engine and the @lid read endpoint. Check related issues #1782, #1810, and #1985 for context. Done means BAILEYS @lid messages can be sent even when marking the chat as read fails or uses the wrong engine.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
GitHub Issue — devlikeapro/waha
Title: [BAILEYS][Chatwoot App] readMessages on @lid chats routes to WEBJS getChat → 500, blocks outbound send
Description
Environment
- WAHA version: 2026.5.1 (
GET /api/versionor error payloadversion.version) - Image:
devlikeapro/waha:latest(digest truncated) - Engine:
WHATSAPP_DEFAULT_ENGINE=BAILEYS - WAHA Apps:
WAHA_APPS_ON=chatwoot - Platform: linux/x64, tier CORE
Steps to reproduce
- Run WAHA with BAILEYS engine and Chatwoot app enabled (inbox API channel).
- Ensure a Chatwoot contact has
custom_attributes.wa_lid(e.g.{numeric_id}@lid) — normal for WhatsApp privacy / Linked ID. - Create an outgoing message in Chatwoot inbox (or via API) so
ChatWootInboxMessageCreatedConsumerruns. - Observe job
chatwoot.inbox | message_createdfail after 3 retries.
Expected behavior
sendTextMessageshould deliver to WhatsApp even if mark-as-read fails, orreadMessageson BAILEYS session should use Baileys implementation, not WEBJS.
Actual behavior
MessageHandler.sendTextMessage calls await session.readMessages(chatId) before sendText:
// /app/dist/apps/chatwoot/consumers/inbox/message_created.js (~line 163)
await session.readMessages(chatId);
await session.startTyping(...);
const msg = await session.sendText(request);
For @lid chat IDs, internal API call fails:
POST /api/default/chats/{lid}@lid/messages/read
→ 500 TypeError: Cannot read properties of undefined (reading 'getChat')
Stack trace shows WEBJS path while session reports BAILEYS:
WhatsappSessionWebJSCore.readChatMessages (session.webjs.core.js:608)
WebjsClientCore.getChatById (whatsapp-web.js Client.js:1171)
WPage.evaluate (webjs/WPage.js:13)
Version block in error JSON:
"version": { "version": "2026.5.1", "engine": "BAILEYS", "tier": "CORE" }
Outbound WhatsApp messages never send because the exception aborts before sendText.
Workaround (local patch)
Wrap readMessages in try/catch in message_created.js so send proceeds:
try { await session.readMessages(chatId); } catch (e) { this.logger.warn(`Skip readMessages: ${e?.message}`); }
Suggested fix (upstream)
- Implement
readChatMessagesfor BAILEYS engine (or route by active engine, not WEBJS fallback). - In Chatwoot app consumer: do not fail the whole send if
readMessagesfails (non-fatal). - Resolve
@lid→@c.usvia/api/{session}/lids/{lid}before read, when applicable.
Related issues
- #1782, #1810, #1985 — similar
getChat/ WEBJS undefined Store errors on@lidchats
Issue filed: https://github.com/devlikeapro/waha/issues/2115
- Lingua principale
- TypeScript
- Stelle
- 7.6k
- Fork
- 1.8k
- Merge medio
- 2g 21h
- PR unite (30g)
- 7
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di devlikeapro/waha
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
devlikeapro/waha#2322 ·
I maintainer di solito rispondono entro 2 giorni
-
patron:PLUS
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
devlikeapro/waha#2167 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 52/100
devlikeapro/waha#2321 ·
I maintainer di solito rispondono entro 2 giorni
-
patron:PLUS
Difficoltà 5/5 Più di una settimana Idoneità per principianti 45/100
devlikeapro/waha#2320 ·
I maintainer di solito rispondono entro 2 giorni
-
GOWS: FAILED has no reason, and temporary ban / stream replaced / client outdated leave the session silently deadForse già presa @diego-goncalves-teixeira l’ha presa 4 giorni fa. Apertapatron:PLUS
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
devlikeapro/waha#2317 ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di devlikeapro/waha
Issue simili
-
area:editor bug issue-form:bug P0 platform:windows review: low
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
1lck/Lithe-IDEA#1388 ·
I maintainer di solito rispondono entro 1 giorno
-
fix(api): isToolAuditEnabled swallows database read errors on auditToolOperations without loggingApertaarea: backend bug priority: low
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
snapotter-hq/SnapOtter#3238 ·
I maintainer di solito rispondono entro 1 giorno
-
rig up --plan times out after 5 s and reports an UNKNOWN outcome while the daemon completes the planAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
filesystem: search_files does not expand non-wildcard excludePatterns like directory_tree doesAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
modelcontextprotocol/servers#5216 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno