fix(carousel): restore viewOnceMessage wrapper for Web/Desktop rendering

WhatsApp Web/Desktop requires interactiveMessage to be wrapped inside
viewOnceMessage.message to render carousels fully. Without the wrapper,
only the header/body text is shown. The previous error 479 was caused by
missing messageVersion and empty messageParamsJson in cards, not by the
viewOnceMessage wrapper itself. Those card fixes are preserved.

https://claude.ai/code/session_01EK9NpViRCtda1WAvFd8ptR
This commit is contained in:
Claude
2026-02-06 16:40:15 +00:00
parent 94737a013f
commit ceb8edb8b1
+13 -6
View File
@@ -658,11 +658,18 @@ export const generateCarouselMessage = async (
}
}
// 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
// Wrap in viewOnceMessage - required for WhatsApp Web/Desktop rendering
// Without this wrapper, Web only shows the header/body text
return {
interactiveMessage
viewOnceMessage: {
message: {
messageContextInfo: {
deviceListMetadata: {},
deviceListMetadataVersion: 2
},
interactiveMessage
}
}
}
}
@@ -1159,8 +1166,8 @@ export const generateWAMessageContent = async (
}
// Pass options for media processing if cards have images/videos
const generated = await generateCarouselMessage(carouselOptions, options)
m.interactiveMessage = generated.interactiveMessage
options.logger?.info('Sending carouselMessage as direct interactiveMessage (no viewOnce wrapper)')
m.viewOnceMessage = generated.viewOnceMessage
options.logger?.info('Sending carouselMessage with viewOnceMessage wrapper')
}
// Check for nativeList
else if (hasNonNullishProperty(message, 'nativeList')) {