mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
Fix: retry cache is not storing (#863)
* Update messages-recv.ts * Update messages-recv.ts
This commit is contained in:
@@ -133,17 +133,18 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
|
||||
}
|
||||
|
||||
const sendRetryRequest = async(node: BinaryNode, forceIncludeKeys = false) => {
|
||||
const msgId = node.attrs.id
|
||||
const { id: msgId, participant } = node.attrs
|
||||
|
||||
let retryCount = msgRetryCache.get<number>(msgId) || 0
|
||||
const key = `${msgId}:${participant}`
|
||||
let retryCount = msgRetryCache.get<number>(key) || 0
|
||||
if(retryCount >= maxMsgRetryCount) {
|
||||
logger.debug({ retryCount, msgId }, 'reached retry limit, clearing')
|
||||
msgRetryCache.del(msgId)
|
||||
msgRetryCache.del(key)
|
||||
return
|
||||
}
|
||||
|
||||
retryCount += 1
|
||||
msgRetryCache.set(msgId, retryCount)
|
||||
msgRetryCache.set(key, retryCount)
|
||||
|
||||
const { account, signedPreKey, signedIdentityKey: identityKey } = authState.creds
|
||||
|
||||
|
||||
Reference in New Issue
Block a user