chore(changelog): update to version 2.3.7 with new features and fixes
Some checks failed
Check Code Quality / check-lint-and-build (push) Has been cancelled
Build Docker image / Build and Deploy (push) Has been cancelled
Security Scan / CodeQL Analysis (javascript) (push) Has been cancelled
Security Scan / Dependency Review (push) Has been cancelled

- Added update and delete endpoints for WhatsApp Business Meta templates.
- Fixed issues with incoming message events and authentication states after reconnection.
- Resolved unique constraint errors in OnWhatsapp cache and optimized database writes.
- Improved proxy integration for media uploads and fixed handling of base64, filename, and caption in the WhatsApp Business API.
- Enhanced chat service reliability and contact filtering capabilities.
- Made multiple integration improvements between Chatwoot and Baileys.
- Refactored code for better quality and consistency.
This commit is contained in:
Davidson Gomes 2025-11-07 14:45:38 -03:00
parent f4043a9141
commit 4ae3139163

View File

@ -1,3 +1,71 @@
# 2.3.7 (2025-11-07)
### Features
* **WhatsApp Business Meta Templates**: Add update and delete endpoints for Meta templates
- New endpoints to edit and delete WhatsApp Business templates
- Added DTOs and validation schemas for template management
- Enhanced template lifecycle management capabilities
### Fixed
* **Baileys Message Processor**: Fix incoming message events not working after reconnection
- Added cleanup logic in mount() to prevent memory leaks from multiple subscriptions
- Recreate messageSubject if it was completed during logout
- Remount messageProcessor in connectToWhatsapp() to ensure subscription is active
- Fixed issue where onDestroy() calls complete() on RxJS Subject, making it permanently closed
- Ensures old subscriptions are properly cleaned up before creating new ones
* **Baileys Authentication**: Resolve "waiting for message" state after reconnection
- Fixed Redis keys not being properly removed during instance logout
- Prevented loading of old/invalid cryptographic keys on reconnection
- Fixed blocking state where instances authenticate but cannot send messages
- Ensures new credentials (creds) are properly used after reconnection
* **OnWhatsapp Cache**: Prevent unique constraint errors and optimize database writes
- Fixed `Unique constraint failed on the fields: (remoteJid)` error when sending to groups
- Refactored query to use OR condition finding by jidOptions or remoteJid
- Added deep comparison to skip unnecessary database updates
- Replaced sequential processing with Promise.allSettled for parallel execution
- Sorted JIDs alphabetically in jidOptions for accurate change detection
- Added normalizeJid helper function for cleaner code
* **Proxy Integration**: Fix "Media upload failed on all hosts" error when using proxy
- Created makeProxyAgentUndici() for Undici-compatible proxy agents
- Fixed compatibility with Node.js 18+ native fetch() implementation
- Replaced traditional HttpsProxyAgent/SocksProxyAgent with Undici ProxyAgent
- Maintained legacy makeProxyAgent() for Axios compatibility
- Fixed protocol handling in makeProxyAgent to prevent undefined errors
* **WhatsApp Business API**: Fix base64, filename and caption handling
- Corrected base64 media conversion in Business API
- Fixed filename handling for document messages
- Improved caption processing for media messages
- Enhanced remoteJid validation and processing
* **Chat Service**: Fix fetchChats and message panel errors
- Fixed cleanMessageData errors in Manager message panel
- Improved chat fetching reliability
- Enhanced message data sanitization
* **Contact Filtering**: Apply where filters correctly in findContacts endpoint
- Fixed endpoint to process all where clause fields (id, remoteJid, pushName)
- Previously only processed remoteJid field, ignoring other filters
- Added remoteJid field to contactValidateSchema for proper validation
- Maintained multi-tenant isolation with instanceId filtering
- Allows filtering contacts by any supported field instead of returning all contacts
* **Chatwoot and Baileys Integration**: Multiple integration improvements
- Enhanced code formatting and consistency
- Fixed integration issues between Chatwoot and Baileys services
- Improved message handling and delivery
### Code Quality & Refactoring
* **Template Management**: Remove unused template edit/delete DTOs after refactoring
* **Proxy Utilities**: Improve makeProxyAgent for Undici compatibility
* **Code Formatting**: Enhance code formatting and consistency across services
# 2.3.6 (2025-10-21)
### Features