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,
|
||||
|
||||
Reference in new issue
Block a user