mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
chore: mutex upsertMessage call from sendMessage
This commit is contained in:
@@ -20,6 +20,7 @@ export const makeMessagesSocket = (config: SocketConfig) => {
|
|||||||
const {
|
const {
|
||||||
ev,
|
ev,
|
||||||
authState,
|
authState,
|
||||||
|
processingMutex,
|
||||||
upsertMessage,
|
upsertMessage,
|
||||||
query,
|
query,
|
||||||
fetchPrivacySettings,
|
fetchPrivacySettings,
|
||||||
@@ -649,7 +650,9 @@ export const makeMessagesSocket = (config: SocketConfig) => {
|
|||||||
await relayMessage(jid, fullMsg.message!, { messageId: fullMsg.key.id!, cachedGroupMetadata: options.cachedGroupMetadata, additionalAttributes })
|
await relayMessage(jid, fullMsg.message!, { messageId: fullMsg.key.id!, cachedGroupMetadata: options.cachedGroupMetadata, additionalAttributes })
|
||||||
if(config.emitOwnEvents) {
|
if(config.emitOwnEvents) {
|
||||||
process.nextTick(() => {
|
process.nextTick(() => {
|
||||||
upsertMessage(fullMsg, 'append')
|
processingMutex.mutex(() => (
|
||||||
|
upsertMessage(fullMsg, 'append')
|
||||||
|
))
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user