Commit 1930f6a
fix(chatwoot): fix multi-attachment message sending failures
Three bugs in the attachment send loop caused multi-file messages from
Chatwoot to fail:
1. No error isolation: if one attachment failed, all subsequent ones
were skipped. Now each attachment has its own try/catch.
2. Caption duplication: the message text was sent with every attachment.
Now only the first attachment carries the caption.
3. No delay between sends: rapid sequential sends overwhelmed Baileys.
Added 1.5s delay between attachments.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 0bda8ef commit 1930f6a
1 file changed
Lines changed: 41 additions & 25 deletions
Lines changed: 41 additions & 25 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1506 | 1506 | | |
1507 | 1507 | | |
1508 | 1508 | | |
| 1509 | + | |
| 1510 | + | |
1509 | 1511 | | |
1510 | | - | |
1511 | | - | |
1512 | | - | |
| 1512 | + | |
| 1513 | + | |
1513 | 1514 | | |
1514 | 1515 | | |
1515 | | - | |
| 1516 | + | |
1516 | 1517 | | |
1517 | 1518 | | |
1518 | | - | |
1519 | | - | |
1520 | | - | |
1521 | | - | |
1522 | | - | |
1523 | | - | |
1524 | | - | |
1525 | | - | |
1526 | | - | |
| 1519 | + | |
| 1520 | + | |
| 1521 | + | |
| 1522 | + | |
| 1523 | + | |
| 1524 | + | |
| 1525 | + | |
| 1526 | + | |
| 1527 | + | |
| 1528 | + | |
| 1529 | + | |
| 1530 | + | |
| 1531 | + | |
| 1532 | + | |
| 1533 | + | |
| 1534 | + | |
| 1535 | + | |
| 1536 | + | |
| 1537 | + | |
| 1538 | + | |
| 1539 | + | |
| 1540 | + | |
| 1541 | + | |
| 1542 | + | |
| 1543 | + | |
| 1544 | + | |
| 1545 | + | |
| 1546 | + | |
| 1547 | + | |
| 1548 | + | |
| 1549 | + | |
| 1550 | + | |
| 1551 | + | |
| 1552 | + | |
| 1553 | + | |
1527 | 1554 | | |
1528 | 1555 | | |
1529 | | - | |
1530 | | - | |
1531 | | - | |
1532 | | - | |
1533 | | - | |
1534 | | - | |
1535 | | - | |
1536 | | - | |
1537 | | - | |
1538 | | - | |
1539 | | - | |
1540 | | - | |
| 1556 | + | |
1541 | 1557 | | |
1542 | 1558 | | |
1543 | 1559 | | |
| |||
0 commit comments