Commit 0701fb3
fix(chatwoot): prevent message sends when WhatsApp instance is disconnected
Adds 3-layer defense against sending messages through a disconnected
Baileys connection, which caused chatwoot to show "failed message" errors:
1. Connection guard in sendMessageWithTyping (universal safety net)
2. Pre-send check in chatwoot receiveWebhook with clear error reporting
3. Reconnection wait (up to 10s) when instance is actively reconnecting
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent ce12371 commit 0701fb3
2 files changed
Lines changed: 39 additions & 0 deletions
File tree
- src/api/integrations
- channel/whatsapp
- chatbot/chatwoot/services
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2308 | 2308 | | |
2309 | 2309 | | |
2310 | 2310 | | |
| 2311 | + | |
| 2312 | + | |
| 2313 | + | |
| 2314 | + | |
| 2315 | + | |
| 2316 | + | |
2311 | 2317 | | |
2312 | 2318 | | |
2313 | 2319 | | |
| |||
Lines changed: 33 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1451 | 1451 | | |
1452 | 1452 | | |
1453 | 1453 | | |
| 1454 | + | |
| 1455 | + | |
| 1456 | + | |
| 1457 | + | |
| 1458 | + | |
| 1459 | + | |
| 1460 | + | |
| 1461 | + | |
| 1462 | + | |
| 1463 | + | |
| 1464 | + | |
| 1465 | + | |
| 1466 | + | |
| 1467 | + | |
| 1468 | + | |
| 1469 | + | |
| 1470 | + | |
| 1471 | + | |
| 1472 | + | |
| 1473 | + | |
| 1474 | + | |
| 1475 | + | |
| 1476 | + | |
| 1477 | + | |
| 1478 | + | |
| 1479 | + | |
| 1480 | + | |
| 1481 | + | |
| 1482 | + | |
| 1483 | + | |
| 1484 | + | |
| 1485 | + | |
| 1486 | + | |
1454 | 1487 | | |
1455 | 1488 | | |
1456 | 1489 | | |
| |||
0 commit comments