From a939a15607a7f0e1a9cfdfc0ef8d7d99e673863d Mon Sep 17 00:00:00 2001 From: Vincent Koc Date: Fri, 6 Mar 2026 01:05:03 -0500 Subject: [PATCH] Gateway: coerce chat deliverable route 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;