From b4bbc511d23fb4129173f1d58a59f75c0c9446a8 Mon Sep 17 00:00:00 2001 From: easedu Date: Sat, 7 Feb 2026 00:41:04 -0300 Subject: [PATCH] fix(baileys): correct JID filter in markMessageAsRead for all user types The condition used isPnUser() which only matches @pn.whatsapp.net JIDs, silently excluding normal users (@s.whatsapp.net) and LID users (@lid). Messages were never actually marked as read for these JID types. Replace allowlist approach (isJidGroup || isPnUser) with denylist (!isJidBroadcast && !isJidNewsletter) to correctly include all valid user and group JIDs while excluding only broadcast and newsletter JIDs. Fixes #2277 --- .../integrations/channel/whatsapp/whatsapp.baileys.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts index 60e857fcc..53b9d0dee 100644 --- a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts +++ b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts @@ -3677,7 +3677,7 @@ export class BaileysStartupService extends ChannelStartupService { try { const keys: proto.IMessageKey[] = []; data.readMessages.forEach((read) => { - if (isJidGroup(read.remoteJid) || isPnUser(read.remoteJid)) { + if (!isJidBroadcast(read.remoteJid) && !isJidNewsletter(read.remoteJid)) { keys.push({ remoteJid: read.remoteJid, fromMe: read.fromMe, id: read.id }); } });