fix(carousel): send as direct interactiveMessage instead of viewOnceMessage

Carousels wrapped in viewOnceMessage cause error 479 rejection.
Pastorini sends carousel as direct interactiveMessage which works
on all platforms including WhatsApp Web/Desktop.

https://claude.ai/code/session_01EK9NpViRCtda1WAvFd8ptR
This commit is contained in:
Claude
2026-02-06 15:13:24 +00:00
parent 4cfa95bb92
commit b67c7b7348
+5 -11
View File
@@ -657,19 +657,13 @@ export const generateCarouselMessage = async (
} }
} }
// Wrap in viewOnceMessage for better compatibility // Return interactiveMessage directly (NOT wrapped in viewOnceMessage)
// Carousels wrapped in viewOnceMessage cause error 479 rejection
// Pastorini sends carousel as direct interactiveMessage which works on all platforms
return { return {
viewOnceMessage: {
message: {
messageContextInfo: {
deviceListMetadata: {},
deviceListMetadataVersion: 2
},
interactiveMessage interactiveMessage
} }
} }
}
}
/** /**
* Generates a list message using Native Flow format (single_select) * Generates a list message using Native Flow format (single_select)
@@ -1164,8 +1158,8 @@ export const generateWAMessageContent = async (
} }
// Pass options for media processing if cards have images/videos // Pass options for media processing if cards have images/videos
const generated = await generateCarouselMessage(carouselOptions, options) const generated = await generateCarouselMessage(carouselOptions, options)
m.viewOnceMessage = generated.viewOnceMessage m.interactiveMessage = generated.interactiveMessage
options.logger?.info('Sending carouselMessage with viewOnceMessage wrapper') options.logger?.info('Sending carouselMessage as direct interactiveMessage (no viewOnce wrapper)')
} }
// Check for nativeList // Check for nativeList
else if (hasNonNullishProperty(message, 'nativeList')) { else if (hasNonNullishProperty(message, 'nativeList')) {