fix: resolve @lid JIDs in messages.update and guard against QR reconnect loop#15
Merged
eksucampusmarketplace-cell merged 1 commit intomainfrom May 9, 2026
Conversation
…ect loop - messages.update: resolve @lid to @s.whatsapp.net using remoteJidAlt before lookups, ensuring status updates match stored messages - connectionUpdate: skip reconnection when connection closes before QR is scanned (no wuid, no statusCode) to prevent infinite loop Based on upstream PR evolution-foundation#2450 Co-Authored-By: [email protected] <[email protected]>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📋 Description
Two fixes backported from upstream EvolutionAPI/evolution-api#2450:
messages.update LID resolution: When WhatsApp sends status updates (DELIVERY_ACK, READ, etc.) with
@lidJIDs, the handler now resolves them to@s.whatsapp.netusingremoteJidAltbefore any database lookups or webhook dispatches. This prevents "Original message not found for update" warnings and ensures status updates match stored messages.connectionUpdate QR loop guard: When the WhatsApp connection closes before a QR code is scanned (no
wuid, nostatusCode), the handler now skips reconnection instead of entering an infinite QR regeneration loop.The
messages.upserthandler already had LID resolution (line 1489), butmessages.updatewas missing it.🔗 Related Issue
Addresses WhatsApp LID (Linked Identity Device) addressing mode issues causing message status mismatches and potential reconnection loops.
🧪 Type of Change
🧪 Testing
📝 Additional Notes
Based on upstream PR EvolutionAPI/evolution-api#2450. Only the relevant LID fixes were cherry-picked — the upstream PR also includes Dockerfile/docker-compose changes and import refactoring that aren't applicable to this fork."
Link to Devin session: https://app.devin.ai/sessions/b564351562db49e7b4422feff7b9785a
Requested by: @eksucampusmarketplace-cell