From b3aeed7fc12576fb1ed70506d1ac64a62fc31e47 Mon Sep 17 00:00:00 2001 From: Davidson Gomes Date: Wed, 17 Apr 2024 18:14:11 -0300 Subject: [PATCH] fix: retry messages --- .../services/whatsapp/whatsapp.baileys.service.ts | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/api/services/whatsapp/whatsapp.baileys.service.ts b/src/api/services/whatsapp/whatsapp.baileys.service.ts index 363a7448e..8fc7a681b 100644 --- a/src/api/services/whatsapp/whatsapp.baileys.service.ts +++ b/src/api/services/whatsapp/whatsapp.baileys.service.ts @@ -1061,8 +1061,6 @@ export class BaileysStartupService extends WAStartupService { } } - await this.messagesLostCache.set(received.key.id, received); - if (received.messageStubParameters && received.messageStubParameters[0] === 'Message absent from node') { this.logger.info('Recovering message lost'); @@ -1070,12 +1068,12 @@ export class BaileysStartupService extends WAStartupService { continue; } - // const retryCache = (await this.messagesLostCache.get(received.key.id)) || null; + const retryCache = (await this.messagesLostCache.get(received.key.id)) || null; - // if (retryCache) { - // this.logger.info('Recovered message lost'); - // await this.messagesLostCache.delete(received.key.id); - // } + if (retryCache) { + this.logger.info('Recovered message lost'); + await this.messagesLostCache.delete(received.key.id); + } if ( (type !== 'notify' && type !== 'append') ||