From d6d21b3ab1e8e0c0170fd066aacc787baf11ca0a Mon Sep 17 00:00:00 2001 From: Vincent Koc Date: Fri, 6 Mar 2026 00:53:18 -0500 Subject: [PATCH] Gateway chat: coerce explicit deliver route flag to boolean --- src/gateway/server-methods/chat.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gateway/server-methods/chat.ts b/src/gateway/server-methods/chat.ts index 18c00f11118..e384006ae38 100644 --- a/src/gateway/server-methods/chat.ts +++ b/src/gateway/server-methods/chat.ts @@ -906,13 +906,14 @@ export const chatHandlers: GatewayRequestHandlers = { (isChannelScopedSession || hasLegacyChannelPeerShape)) || (isConfiguredMainSessionScope && client?.connect !== undefined && !isFromWebchatClient)), ); - const hasDeliverableRoute = + const hasDeliverableRoute = Boolean( shouldDeliverExternally && canInheritDeliverableRoute && routeChannelCandidate && routeChannelCandidate !== INTERNAL_MESSAGE_CHANNEL && typeof routeToCandidate === "string" && - routeToCandidate.trim().length > 0; + routeToCandidate.trim().length > 0, + ); const originatingChannel = hasDeliverableRoute ? routeChannelCandidate : INTERNAL_MESSAGE_CHANNEL;