[core] WEBJS - ignore 2 days or older reactions

mention #494
This commit is contained in:
devlikepro committed 2026-04-15 13:05:23 +07:00
1 parent 798d782869
commit c8f067229b
1 file changed
+9
@@ -207,6 +207,7 @@ export class WhatsappSessionWebJSCore extends WhatsappSession {
private engineStateCheckDelayedJob: SingleDelayedJobRunner;
private shouldRestart: boolean;
private lastQRDate: Date = null;
private static readonly REACTION_MAX_AGE_MS = 2 * 24 * 60 * 60 * 1000;
whatsapp: WebjsClientCore;
protected qr: QR;
@@ -2026,6 +2027,14 @@ export class WhatsappSessionWebJSCore extends WhatsappSession {
}
}
// Ignore reactions older than 2 days to prevent stale reactions
// when session reconnects and replays buffered events
const twoDaysAgoSec =
(Date.now() - WhatsappSessionWebJSCore.REACTION_MAX_AGE_MS) / 1000;
if (reaction.timestamp < twoDaysAgoSec) {
return null;
}
const source = this.getMessageSource(reaction.id.id);
return {
id: reaction.id._serialized,