feat: mutex processing in a chat to preserve order of events

This commit is contained in:
Adhiraj Singh
2022-01-22 14:07:06 +05:30
parent a06f639774
commit 1f2a6641f3
4 changed files with 182 additions and 141 deletions

View File

@@ -2,7 +2,7 @@ import { Boom } from '@hapi/boom'
import { proto } from '../../WAProto'
import { AppStateChunk, Chat, ChatModification, ChatMutation, Contact, LTHashState, PresenceData, SocketConfig, WABusinessHoursConfig, WABusinessProfile, WAMediaUpload, WAPatchCreate, WAPatchName, WAPresence } from '../Types'
import { chatModificationToAppPatch, decodePatches, decodeSyncdSnapshot, encodeSyncdPatch, extractSyncdPatches, generateProfilePicture, newLTHashState, toNumber } from '../Utils'
import makeMutex from '../Utils/make-mutex'
import { makeMutex } from '../Utils/make-mutex'
import { BinaryNode, getBinaryNodeChild, getBinaryNodeChildren, jidNormalizedUser, reduceBinaryNodeToDictionary, S_WHATSAPP_NET } from '../WABinary'
import { makeMessagesSocket } from './messages-send'