Skip to content

Commit 6edaa63

Browse files
authored
Merge branch 'EvolutionAPI:develop' into develop
2 parents c9d625b + 4f642e1 commit 6edaa63

22 files changed

Lines changed: 559 additions & 159 deletions

File tree

.DS_Store

0 Bytes
Binary file not shown.

CHANGELOG.md

Lines changed: 84 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# 2.3.7 (develop)
1+
# 2.3.7 (2025-12-05)
22

33
### Features
44

@@ -7,6 +7,24 @@
77
- Added DTOs and validation schemas for template management
88
- Enhanced template lifecycle management capabilities
99

10+
* **Events API**: Add isLatest and progress to messages.set event
11+
- Allows consumers to know when history sync is complete (isLatest=true)
12+
- Track sync progress percentage through webhooks
13+
- Added extra field to EmitData type for additional payload properties
14+
- Updated all event controllers (webhook, rabbitmq, sqs, websocket, pusher, kafka, nats)
15+
16+
* **N8N Integration**: Add quotedMessage to payload in sendMessageToBot
17+
- Support for quoted messages in N8N chatbot integration
18+
- Enhanced message context information
19+
20+
* **WebSocket**: Add wildcard "*" to allow all hosts to connect via websocket
21+
- More flexible host configuration for WebSocket connections
22+
- Improved host validation logic in WebsocketController
23+
24+
* **Pix Support**: Handle interactive button message for pix
25+
- Support for interactive Pix button messages
26+
- Enhanced payment flow integration
27+
1028
### Fixed
1129

1230
* **Baileys Message Processor**: Fix incoming message events not working after reconnection
@@ -60,11 +78,76 @@
6078
- Fixed integration issues between Chatwoot and Baileys services
6179
- Improved message handling and delivery
6280

81+
* **Baileys Message Loss**: Prevent message loss from WhatsApp stub placeholders
82+
- Fixed messages being lost and not saved to database, especially for channels/newsletters (@lid)
83+
- Detects WhatsApp stubs through messageStubParameters containing 'Message absent from node'
84+
- Prevents adding stubs to duplicate message cache
85+
- Allows real message to be processed when it arrives after decryption
86+
- Maintains stub discard to avoid saving empty placeholders
87+
88+
* **Database Contacts**: Respect DATABASE_SAVE_DATA_CONTACTS in contact updates
89+
- Added missing conditional checks for DATABASE_SAVE_DATA_CONTACTS configuration
90+
- Fixed profile picture updates attempting to save when database save is disabled
91+
- Fixed unawaited promise in contacts.upsert handler
92+
93+
* **Prisma/PostgreSQL**: Add unique constraint to Chat model
94+
- Generated migration to add unique index on instanceId and remoteJid
95+
- Added deduplication step before creating index to prevent constraint violations
96+
- Prevents chat duplication in database
97+
98+
* **MinIO Upload**: Handle messageContextInfo in media upload to prevent MinIO errors
99+
- Prevents errors when uploading media with messageContextInfo metadata
100+
- Improved error handling for media storage operations
101+
102+
* **Typebot**: Fix message routing for @lid JIDs
103+
- Typebot now responds to messages from JIDs ending with @lid
104+
- Maintains complete JID for @lid instead of extracting only number
105+
- Fixed condition: `remoteJid.includes('@lid') ? remoteJid : remoteJid.split('@')[0]`
106+
- Handles both @s.whatsapp.net and @lid message formats
107+
108+
* **Message Filtering**: Unify remoteJid filtering using OR with remoteJidAlt
109+
- Improved message filtering with alternative JID support
110+
- Better handling of messages with different JID formats
111+
112+
* **@lid Integration**: Multiple fixes for @lid problems, message events and chatwoot errors
113+
- Reorganized imports and improved message handling in BaileysStartupService
114+
- Enhanced remoteJid processing to handle @lid cases
115+
- Improved jid normalization and type safety in Chatwoot integration
116+
- Streamlined message handling logic and cache management
117+
- Refactored message handling and polling updates with decryption logic for poll votes
118+
- Improved event processing flow for various message types
119+
120+
* **Chatwoot Contacts**: Fix contact duplication error on import
121+
- Resolved 'ON CONFLICT DO UPDATE command cannot affect row a second time' error
122+
- Removed attempt to update identifier field in conflict (part of constraint)
123+
- Changed to update only updated_at field: `updated_at = NOW()`
124+
- Allows duplicate contacts to be updated correctly without errors
125+
126+
* **Chatwoot Service**: Fix async handling in update_last_seen method
127+
- Added missing await for chatwootRequest in read message processing
128+
- Prevents service failure when processing read messages
129+
130+
* **Metrics Access**: Fix IP validation including x-forwarded-for
131+
- Uses all IPs including x-forwarded-for header when checking metrics access
132+
- Improved security and access control for metrics endpoint
133+
134+
### Dependencies
135+
136+
* **Baileys**: Updated to version 7.0.0-rc.9
137+
- Latest release candidate with multiple improvements and bug fixes
138+
139+
* **AWS SDK**: Updated packages to version 3.936.0
140+
- Enhanced functionality and compatibility
141+
- Performance improvements
142+
63143
### Code Quality & Refactoring
64144

65145
* **Template Management**: Remove unused template edit/delete DTOs after refactoring
66146
* **Proxy Utilities**: Improve makeProxyAgent for Undici compatibility
67147
* **Code Formatting**: Enhance code formatting and consistency across services
148+
* **BaileysStartupService**: Fix indentation and remove unnecessary blank lines
149+
* **Event Controllers**: Guard extra spread and prevent core field override in all event controllers
150+
* **Import Organization**: Reorganize imports for better code structure and maintainability
68151

69152
# 2.3.6 (2025-10-21)
70153

package-lock.json

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@
9090
"fluent-ffmpeg": "^2.1.3",
9191
"form-data": "^4.0.1",
9292
"https-proxy-agent": "^7.0.6",
93+
"fetch-socks": "^1.3.2",
9394
"i18next": "^23.7.19",
9495
"jimp": "^1.6.0",
9596
"json-schema": "^0.4.0",
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
-- 1. Cleanup: Remove duplicate chats, keeping the most recently updated one
2+
DELETE FROM "Chat"
3+
WHERE id IN (
4+
SELECT id FROM (
5+
SELECT id,
6+
ROW_NUMBER() OVER (
7+
PARTITION BY "instanceId", "remoteJid"
8+
ORDER BY "updatedAt" DESC
9+
) as row_num
10+
FROM "Chat"
11+
) t
12+
WHERE t.row_num > 1
13+
);
14+
15+
-- 2. Create the unique index (Constraint)
16+
CREATE UNIQUE INDEX "Chat_instanceId_remoteJid_key" ON "Chat"("instanceId", "remoteJid");

prisma/postgresql-schema.prisma

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ model Chat {
132132
instanceId String
133133
unreadMessages Int @default(0)
134134
135+
@@unique([instanceId, remoteJid])
135136
@@index([instanceId])
136137
@@index([remoteJid])
137138
}

0 commit comments

Comments
 (0)