I’m experiencing an intermittent issue with Baileys where my bot sometimes responds to the wrong conversation.
Expected behavior:
When a user sends a message, Baileys should respond to the same remoteJid from which the message was received.
Actual behavior:
Occasionally, Baileys interprets the remoteJid incorrectly.
Example:
Correct remoteJid from incoming message: 123456@s.whatsapp.net but instead received message from 654231@s.whatsapp.net and replying, Baileyssends to 654231@s.whatsapp.net, which is not even an existing WhatsApp number.
This causes the bot to create a new conversation with this random number instead of replying in the correct thread.
Frequency:
Happens sporadically, not every message, but enough to cause problems in production.
Environment:
Baileys version: 6.7.18
Node.js version: 22
Platform: Ubantu
you can see messages are send to a random number

I’m experiencing an intermittent issue with Baileys where my bot sometimes responds to the wrong conversation.
Expected behavior:
When a user sends a message, Baileys should respond to the same remoteJid from which the message was received.
Actual behavior:
Occasionally, Baileys interprets the remoteJid incorrectly.
Example:
Correct remoteJid from incoming message: 123456@s.whatsapp.net but instead received message from 654231@s.whatsapp.net and replying, Baileyssends to 654231@s.whatsapp.net, which is not even an existing WhatsApp number.
This causes the bot to create a new conversation with this random number instead of replying in the correct thread.
Frequency:
Happens sporadically, not every message, but enough to cause problems in production.
Environment:
Baileys version: 6.7.18
Node.js version: 22
Platform: Ubantu
you can see messages are send to a random number