From ab0ab936d418c595358699a945f3c3e0c38748e1 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 6 Feb 2026 14:43:13 +0000 Subject: [PATCH] fix(buttons): revert native_flow name to 'mixed' - empty string causes error 405 Empty name '' is rejected by WhatsApp server (error 405 in ack). Reverted to 'mixed' which delivers successfully. The key fix remains: no bot node for CTA-only buttons (Web compatibility). https://claude.ai/code/session_01EK9NpViRCtda1WAvFd8ptR --- src/Socket/messages-send.ts | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/Socket/messages-send.ts b/src/Socket/messages-send.ts index 49548462..4dc539d8 100644 --- a/src/Socket/messages-send.ts +++ b/src/Socket/messages-send.ts @@ -1291,12 +1291,9 @@ export const makeMessagesSocket = (config: SocketConfig) => { '[EXPERIMENTAL] Injected biz node for listMessage (legacy format)' ) } else { - // Determine the native_flow name based on actual button types - // Based on WhatsApp client traffic analysis (see getButtonArgs), - // the default name for regular native_flow buttons should be '' (empty) - // Only special flows (payment, mpm, order) need specific names - // Using '' for all regular buttons (CTA and quick_reply) ensures - // maximum compatibility with WhatsApp Web + // Use 'mixed' as the native_flow name - this is required for message delivery + // Note: '' (empty) causes error 405 rejection from WhatsApp server + // Special flows (payment, mpm, order) use specific names const SPECIAL_FLOW_NAMES: Record = { 'review_and_pay': 'payment_info', 'payment_info': 'payment_info', @@ -1304,12 +1301,10 @@ export const makeMessagesSocket = (config: SocketConfig) => { 'review_order': 'order_details' } const firstButtonName = allButtonNames[0] || '' - - // Check if this is a special flow type, otherwise use '' for Web compatibility - const nativeFlowName = SPECIAL_FLOW_NAMES[firstButtonName] || '' + const nativeFlowName = SPECIAL_FLOW_NAMES[firstButtonName] || 'mixed' logger.info( - { msgId, buttonNames: allButtonNames, hasCTA, hasQuickReply, isCTAOnly, nativeFlowName, firstButtonName }, + { msgId, buttonNames: allButtonNames, hasCTA, hasQuickReply, isCTAOnly, nativeFlowName }, '[EXPERIMENTAL] Determined native_flow name based on button types' )