Skip to content

Commit

Permalink
Merge branch 'WhiskeySockets:master' into send-server-ack
Browse files Browse the repository at this point in the history
  • Loading branch information
MateusFrFreitas authored Jan 31, 2025
2 parents 1c61a6f + 137b6ee commit 6f4d79e
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## 6.7.9 (2024-10-22)
## 6.7.10 (2025-01-31)



2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "baileys",
"version": "6.7.9",
"version": "6.7.10",
"description": "WhatsApp API",
"keywords": [
"whatsapp",
Expand Down
26 changes: 14 additions & 12 deletions src/Socket/messages-recv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions src/WABinary/encode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,6 @@ const encodeBinaryNodeInner = (
pushByte(tokenIndex.index)
} else if(isNibble(str)) {
writePackedBytes(str, 'nibble')
} else if(isHex(str)) {
writePackedBytes(str, 'hex')
} else if(str) {
const decodedJid = jidDecode(str)
if(decodedJid) {
Expand Down

0 comments on commit 6f4d79e

Please sign in to comment.