Skip to content

fix: resolve @lid JIDs in messages.update and guard against QR reconnect loop#15

Merged
eksucampusmarketplace-cell merged 1 commit intomainfrom
devin/1778366135-lid-fix-messages-update
May 9, 2026
Merged

fix: resolve @lid JIDs in messages.update and guard against QR reconnect loop#15
eksucampusmarketplace-cell merged 1 commit intomainfrom
devin/1778366135-lid-fix-messages-update

Conversation

@devin-ai-integration
Copy link
Copy Markdown

📋 Description

Two fixes backported from upstream EvolutionAPI/evolution-api#2450:

  1. messages.update LID resolution: When WhatsApp sends status updates (DELIVERY_ACK, READ, etc.) with @lid JIDs, the handler now resolves them to @s.whatsapp.net using remoteJidAlt before any database lookups or webhook dispatches. This prevents "Original message not found for update" warnings and ensures status updates match stored messages.

  2. connectionUpdate QR loop guard: When the WhatsApp connection closes before a QR code is scanned (no wuid, no statusCode), the handler now skips reconnection instead of entering an infinite QR regeneration loop.

The messages.upsert handler already had LID resolution (line 1489), but messages.update was missing it.

🔗 Related Issue

Addresses WhatsApp LID (Linked Identity Device) addressing mode issues causing message status mismatches and potential reconnection loops.

🧪 Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)

🧪 Testing

  • Manual testing completed — will be deployed to VPS and tested with session 035a125f
  • No breaking changes introduced
  • Tested with different connection types (if applicable)

📝 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

…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]>
@devin-ai-integration
Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@eksucampusmarketplace-cell eksucampusmarketplace-cell deleted the devin/1778366135-lid-fix-messages-update branch May 9, 2026 22:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant