mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
hotfix: always send acks even in case of errors (#1043)
This commit is contained in:
@@ -622,6 +622,7 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
|
|||||||
ids.push(...items.map(i => i.attrs.id))
|
ids.push(...items.map(i => i.attrs.id))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
processingMutex.mutex(
|
processingMutex.mutex(
|
||||||
async() => {
|
async() => {
|
||||||
@@ -680,9 +681,11 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
),
|
)
|
||||||
sendMessageAck(node)
|
|
||||||
])
|
])
|
||||||
|
} finally {
|
||||||
|
await sendMessageAck(node)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleNotification = async(node: BinaryNode) => {
|
const handleNotification = async(node: BinaryNode) => {
|
||||||
@@ -693,6 +696,7 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
processingMutex.mutex(
|
processingMutex.mutex(
|
||||||
async() => {
|
async() => {
|
||||||
@@ -713,9 +717,11 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
|
|||||||
await upsertMessage(fullMsg, 'append')
|
await upsertMessage(fullMsg, 'append')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
),
|
)
|
||||||
sendMessageAck(node)
|
|
||||||
])
|
])
|
||||||
|
} finally {
|
||||||
|
await sendMessageAck(node)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleMessage = async(node: BinaryNode) => {
|
const handleMessage = async(node: BinaryNode) => {
|
||||||
@@ -761,6 +767,7 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
processingMutex.mutex(
|
processingMutex.mutex(
|
||||||
async() => {
|
async() => {
|
||||||
@@ -814,9 +821,11 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
|
|||||||
|
|
||||||
await upsertMessage(msg, node.attrs.offline ? 'append' : 'notify')
|
await upsertMessage(msg, node.attrs.offline ? 'append' : 'notify')
|
||||||
}
|
}
|
||||||
),
|
)
|
||||||
sendMessageAck(node)
|
|
||||||
])
|
])
|
||||||
|
} finally {
|
||||||
|
await sendMessageAck(node)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const fetchMessageHistory = async(
|
const fetchMessageHistory = async(
|
||||||
|
|||||||
Reference in New Issue
Block a user