diff --git a/src/Socket/messages-recv.ts b/src/Socket/messages-recv.ts index 33444e6..014b5bb 100644 --- a/src/Socket/messages-recv.ts +++ b/src/Socket/messages-recv.ts @@ -943,18 +943,20 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => { const handleBadAck = async({ attrs }: BinaryNode) => { const key: WAMessageKey = { remoteJid: attrs.from, fromMe: true, id: attrs.id } - // current hypothesis is that if pash is sent in the ack - // it means -- the message hasn't reached all devices yet - // we'll retry sending the message here - if(attrs.phash) { - logger.info({ attrs }, 'received phash in ack, resending message...') - const msg = await getMessage(key) - if(msg) { - await relayMessage(key.remoteJid!, msg, { messageId: key.id!, useUserDevicesCache: false }) - } else { - logger.warn({ attrs }, 'could not send message again, as it was not found') - } - } + + // WARNING: REFRAIN FROM ENABLING THIS FOR NOW. IT WILL CAUSE A LOOP + // // current hypothesis is that if pash is sent in the ack + // // it means -- the message hasn't reached all devices yet + // // we'll retry sending the message here + // if(attrs.phash) { + // logger.info({ attrs }, 'received phash in ack, resending message...') + // const msg = await getMessage(key) + // if(msg) { + // await relayMessage(key.remoteJid!, msg, { messageId: key.id!, useUserDevicesCache: false }) + // } else { + // logger.warn({ attrs }, 'could not send message again, as it was not found') + // } + // } // error in acknowledgement, // device could not display the message