Skip to content

Commit

Permalink
fix: retry messages
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidsonGomes committed Apr 17, 2024
1 parent 5ae5d85 commit b3aeed7
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/api/services/whatsapp/whatsapp.baileys.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1061,21 +1061,19 @@ 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');

await this.messagesLostCache.set(received.key.id, received);
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') ||
Expand Down

0 comments on commit b3aeed7

Please sign in to comment.