From 20d606c4c4bef7a2518fc8b9684fab7bcaadc358 Mon Sep 17 00:00:00 2001 From: juanpablodlc <92012363+juanpablodlc@users.noreply.github.com> Date: Sun, 11 Jan 2026 20:09:41 -0800 Subject: [PATCH] fix: use logical OR for sender ID fallback in command auth The nullish coalescing operator (??) only skips null/undefined, not empty strings. For direct WhatsApp messages, ctx.SenderId was an empty string, causing senderRaw to be "" instead of falling through to the valid ctx.SenderE164 value. This caused commands like /status to be rejected with "unauthorized sender" for self-chat WhatsApp messages. Tested: Verified /status command now works correctly for self-chat WhatsApp messages after the fix. --- src/auto-reply/command-auth.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/auto-reply/command-auth.ts b/src/auto-reply/command-auth.ts index a31ecbe49..db268e124 100644 --- a/src/auto-reply/command-auth.ts +++ b/src/auto-reply/command-auth.ts @@ -96,7 +96,7 @@ export function resolveCommandAuthorization(params: { } const ownerList = ownerCandidates; - const senderRaw = ctx.SenderId ?? ctx.SenderE164 ?? from; + const senderRaw = ctx.SenderId || ctx.SenderE164 || from; const senderId = senderRaw ? formatAllowFromList({ dock,