chore: ack history before processing

This commit is contained in:
Adhiraj Singh
2022-03-21 23:29:56 +05:30
parent e731de5deb
commit 5e80f5ace3

View File

@@ -135,7 +135,6 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
const histNotification = protocolMsg!.historySyncNotification
logger.info({ histNotification, id: message.key.id }, 'got history notification')
const { chats, contacts, messages, isLatest } = await downloadAndProcessHistorySyncNotification(histNotification, historyCache)
const meJid = authState.creds.me!.id
await sendNode({
@@ -147,6 +146,8 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
}
})
const { chats, contacts, messages, isLatest } = await downloadAndProcessHistorySyncNotification(histNotification, historyCache)
if(chats.length) {
ev.emit('chats.set', { chats, isLatest })
}