chore: move ack of notification before processing

This commit is contained in:
Adhiraj Singh
2022-03-29 13:41:25 +05:30
parent 3d63b8fa01
commit bb9f233de4

View File

@@ -527,6 +527,7 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
const handleNotification = async(node: BinaryNode) => {
const remoteJid = node.attrs.from
await sendMessageAck(node, { class: 'notification', type: node.attrs.type })
await processingMutex.mutex(
remoteJid,
() => {
@@ -548,8 +549,6 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
}
}
)
await sendMessageAck(node, { class: 'notification', type: node.attrs.type })
}
const handleUpsertedMessages = async({ messages, type }: BaileysEventMap<any>['messages.upsert']) => {