Describe the bug
When using baileys version 6.7.20, the messages.upsert event is not triggered when sending messages to certain numbers if both the sender and receiver's official WhatsApp applications (Web or App) are offline. Through debugging, it was observed that the corresponding
ws.on('CB:receipt', node => {
processNode('receipt', node, 'handling receipt', handleReceipt);
});
event does not receive any callbacks.
To Reproduce
- Create a WhatsApp connection using baileys 6.7.20
- Ensure both sender and receiver's official WhatsApp applications are offline
- Send a message to a target number through baileys
- Listen for the messages.upsert event
- Observe that the event is not triggered
Not all number can reproduce, but mine number and some user's can
Expected behavior
The messages.upsert event should be triggered
Environment (please complete the following information):
const socket = BaileysService.makeWASocket({
// printQRInTerminal: true,
browser: BaileysService.Browsers.macOS('Chrome'),
msgRetryCounterCache,
generateHighQualityLinkPreview: true,
mobile: false,
auth: {
creds: state.creds,
keys: BaileysService.makeCacheableSignalKeyStore(
state.keys,
pinLogger as unknown as any,
),
},
version,
logger: pinLogger,
syncFullHistory: true,
cachedGroupMetadata: async (id) => await this.getGroups(id),
shouldIgnoreJid: (jid) => BaileysService.isJidBroadcast(jid),
getMessage: async (key) => {
const data = await prisma.message.findUnique({
where: {
sessionId_remoteJid_id: {
sessionId: this.id,
remoteJid: BaileysService.jidNormalizedUser(key.remoteJid!),
id: key.id!,
},
},
});
// console.log('socket-getMessage', key, data);
return (data?.message || undefined) as proto.IMessage | undefined;
},
...this.config,
} as unknown as UserFacingSocketConfig);
- Do you have multiple clients on the same IP?
No
- Are you using a proxy?\
- Yes
Additional context
- This may be related to WhatsApp's message delivery mechanism behavior when users are offline
- Suggest investigating whether additional event listeners or configurations are needed to handle message receipts in offline scenarios
Describe the bug
When using baileys version 6.7.20, the messages.upsert event is not triggered when sending messages to certain numbers if both the sender and receiver's official WhatsApp applications (Web or App) are offline. Through debugging, it was observed that the corresponding
event does not receive any callbacks.
To Reproduce
Not all number can reproduce, but mine number and some user's can
Expected behavior
The
messages.upsertevent should be triggeredEnvironment (please complete the following information):
Is this on a server?
Yes
What do your
connectOptionslook like?No
Additional context