fix: use native_flow for all interactive messages to avoid error 479
Testing showed that using type='list' for list messages (even those using nativeFlowMessage with single_select) causes error 479 rejection. All interactive message types (buttons, lists, carousels) now use type='native_flow' in the biz node structure. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1176,13 +1176,10 @@ export const makeMessagesSocket = (config: SocketConfig) => {
|
|||||||
metrics.interactiveMessagesSent.inc({ type: buttonType })
|
metrics.interactiveMessagesSent.inc({ type: buttonType })
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Use nested structure: biz > interactive > [type]
|
// Use nested structure: biz > interactive > native_flow
|
||||||
// This matches the working Astra-Api implementation
|
// All interactive messages (buttons, lists, carousels) use native_flow
|
||||||
// For native_flow: biz > interactive(type=native_flow) > native_flow
|
// Testing showed that type='list' causes error 479
|
||||||
// For list: biz > interactive(type=list) > list
|
const interactiveType = 'native_flow'
|
||||||
// Note: Lists sent as nativeFlowMessage still need type='list'
|
|
||||||
const isListMessage = buttonType === 'list' || isListNativeFlow(message)
|
|
||||||
const interactiveType = isListMessage ? 'list' : 'native_flow'
|
|
||||||
;(stanza.content as BinaryNode[]).push({
|
;(stanza.content as BinaryNode[]).push({
|
||||||
tag: 'biz',
|
tag: 'biz',
|
||||||
attrs: {},
|
attrs: {},
|
||||||
|
|||||||
Reference in New Issue
Block a user