-
Notifications
You must be signed in to change notification settings - Fork 3.6k
fix(chatwoot): avoid "undefined" caption on group audio messages #1434
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(chatwoot): avoid "undefined" caption on group audio messages #1434
Conversation
Reviewer's GuideThis pull request primarily resolves an issue where audio messages in WhatsApp groups lacking captions incorrectly displayed "undefined" in Chatwoot; this is now handled by sending an empty string. However, the scope of this PR extends significantly beyond this single fix. It introduces NATS as a new event messaging system, configured similarly to existing RabbitMQ/SQS integrations, and adds new capabilities for fetching WhatsApp Business catalogs and collections via dedicated service methods, controllers, and routes. Message processing is enhanced through improved duplicate message prevention using caching, more robust message editing/deletion logic with database persistence and webhook dispatches, and better support for animated WebP stickers including specific audio conversion parameters. SQS queue management has been refactored using AWS SDK v3 for more reliable queue creation and listing. WebSocket connections now enforce API key-based authentication. Outgoing webhooks can now utilize JWT-based authentication if configured. Services for fetching contacts and chats have been updated to support pagination and return richer data. A notable security enhancement involves replacing File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @edisonmartinsmkt - I've reviewed your changes - here's some feedback:
- This PR's scope is much larger than the title suggests; consider separating the Chatwoot fix from new features like NATS, Business Catalog, and the security patch.
- Given the security fix replacing
execSync
, consider a broader audit for similar shell command execution patterns in the codebase. - The significantly refactored raw SQL query in
getChats
warrants a performance review, especially with large datasets.
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
This PR fixes an issue where incoming audio messages in WhatsApp groups were displaying the text "undefined" as a caption in Chatwoot.
The change ensures that if no caption is present in the
audioMessage
, an empty string is sent instead — preventing the literal string "undefined" from appearing in the UI.Before:

🟥 The word "undefined" was shown above the audio player when no caption existed.
After:

✅ No caption is displayed, keeping the interface clean.
Summary by Sourcery
Fix an issue with audio message captions in WhatsApp group messages by ensuring an empty string is used when no caption is present
Bug Fixes:
Enhancements: