🐞 [BUG] messages.upsert event not triggered under high message load
Describe the bug
When the instance receives a high volume of incoming messages, the messages.upsert event occasionally stops being triggered for some clients. As a result, certain user flows cannot respond to those messages because the event is never fired. This happens sporadically across a few instances and seems correlated with high incoming message volume.
It’s not a hardware limitation the server has significantly more resources than required for normal operation.
To Reproduce
- Create a new Baileys connection.
- Start receiving a large number of incoming messages in a short period.
- Observe that at some point,
messages.upsert stops being emitted for certain messages.
Expected behavior
The messages.upsert event should always be triggered for every incoming message, regardless of message volume or load.
Environment (please complete the following information):
- Baileys version:
7.0.0-rc.5
- Server environment: Yes
- Multiple clients on the same IP: Sometimes
- Using proxy: No
- connectOptions:
{
markOnlineOnConnect: false,
syncFullHistory: false,
generateHighQualityLinkPreview: false,
connectTimeoutMs: 5 * 60 * 1000,
defaultQueryTimeoutMs: 5 * 60 * 1000
}
Additional context
I skip specific message types in my message handler, as shown below:
// Skip processing group messages
if (
m?.key?.remoteJid?.endsWith('@g.us') ||
m?.key?.remoteJid?.endsWith('@broadcast') ||
m?.key?.remoteJid?.endsWith('@newsletter') ||
m?.key?.remoteJid === 'status@broadcast'
) {
continue;
}
The skipped messages include:
- Group chat messages (
@g.us)
- Broadcast messages (
@broadcast)
- Newsletter messages (
@newsletter)
- Status updates (
status@broadcast)
Even with these filters, the issue still occurs occasionally when message throughput is high.
🐞 [BUG] messages.upsert event not triggered under high message load
Describe the bug
When the instance receives a high volume of incoming messages, the
messages.upsertevent occasionally stops being triggered for some clients. As a result, certain user flows cannot respond to those messages because the event is never fired. This happens sporadically across a few instances and seems correlated with high incoming message volume.It’s not a hardware limitation the server has significantly more resources than required for normal operation.
To Reproduce
messages.upsertstops being emitted for certain messages.Expected behavior
The
messages.upsertevent should always be triggered for every incoming message, regardless of message volume or load.Environment (please complete the following information):
7.0.0-rc.5{
markOnlineOnConnect: false,
syncFullHistory: false,
generateHighQualityLinkPreview: false,
connectTimeoutMs: 5 * 60 * 1000,
defaultQueryTimeoutMs: 5 * 60 * 1000
}
Additional context
I skip specific message types in my message handler, as shown below:
The skipped messages include:
@g.us)@broadcast)@newsletter)status@broadcast)Even with these filters, the issue still occurs occasionally when message throughput is high.