From 05527303513530b1fd2bac3f50f140a103d409a5 Mon Sep 17 00:00:00 2001 From: Nick Sullivan Date: Thu, 29 Jan 2026 13:41:23 -0600 Subject: [PATCH] test(whatsapp): fix reaction normalization test with per-peer dmScope The test was using default dmScope (main), which routes all DMs to the same session key regardless of peer ID. This masked the bug we were testing for. Now uses session.dmScope='per-peer' so normalized vs JID peer IDs actually produce different session keys, properly testing that reactions land in the E.164-normalized session. Co-Authored-By: Claude Opus 4.5 --- ...o-reply.whatsapp-inbound-reaction-system-events.test.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/web/auto-reply.whatsapp-inbound-reaction-system-events.test.ts b/src/web/auto-reply.whatsapp-inbound-reaction-system-events.test.ts index 8145e3e1d..8c7ca5bf7 100644 --- a/src/web/auto-reply.whatsapp-inbound-reaction-system-events.test.ts +++ b/src/web/auto-reply.whatsapp-inbound-reaction-system-events.test.ts @@ -189,6 +189,7 @@ describe("web auto-reply – inbound reaction system events", () => { setLoadConfigMock(() => ({ channels: { whatsapp: { allowFrom: ["*"] } }, messages: {}, + session: { dmScope: "per-peer" }, })); let capturedOnReaction: ((reaction: WebInboundReaction) => void) | undefined; @@ -202,7 +203,11 @@ describe("web auto-reply – inbound reaction system events", () => { await monitorWebChannel(false, listenerFactory, false); - const cfg = { channels: { whatsapp: { allowFrom: ["*"] } }, messages: {} }; + const cfg = { + channels: { whatsapp: { allowFrom: ["*"] } }, + messages: {}, + session: { dmScope: "per-peer" }, + }; // For DM reactions with senderE164, the peer ID should be normalized to E.164 // to match how messages are routed (via resolvePeerId).