messages-recv: DISABLE MESSAGE RESEND

This commit is contained in:
Rajeh Taher
2025-01-31 20:46:13 +02:00
parent 3fca643d92
commit 9f61f3acf0

View File

@@ -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