Repository navigation
Fix/interactive buttons - #2764
Closed
delapazfonseca21 wants to merge 4 commits into
Closed
delapazfonseca21 wants to merge 4 commits into
delapazfonseca21 wants to merge 4 commits into
Conversation
added 4 commits
August 11, 2026 20:06
- Add interactiveMessage.helper.ts with buildInteractiveBizNode and buildListBizNode - Remove viewOnceMessage wrapper from buttonMessage (PIX + general) - Switch listMessage to legacy format with SINGLE_SELECT listType - Add additionalNodes parameter to sendMessage and sendMessageWithTyping - Inject <biz><interactive/></biz> node for buttons and <biz><list/></biz> for lists This fixes button/list rendering on WhatsApp Web and Desktop clients.
Contributor
Reviewer's GuideFixes WhatsApp Web/Desktop rendering for interactive buttons and lists by using compatible message payloads and injected Biz nodes, while extending the send pipeline to carry those nodes. The Docker image build is also switched to a new fast tsup configuration. Sequence diagram for WhatsApp interactive message deliverysequenceDiagram
participant API
participant BaileysStartupService
participant WhatsApp
participant WebDesktop
API->>BaileysStartupService: sendMessageWithTyping
BaileysStartupService->>BaileysStartupService: buildInteractiveBizNode
BaileysStartupService->>WhatsApp: relayMessage with interactiveMessage and additionalNodes
WhatsApp-->>WebDesktop: Render native flow buttons
Sequence diagram for legacy WhatsApp list deliverysequenceDiagram
participant API
participant BaileysStartupService
participant WhatsApp
participant WebDesktop
API->>BaileysStartupService: listMessage
BaileysStartupService->>BaileysStartupService: buildListBizNode
BaileysStartupService->>WhatsApp: relayMessage with listMessage SINGLE_SELECT and additionalNodes
WhatsApp-->>WebDesktop: Render selectable list
Flow diagram for compatible WhatsApp message payload selectionflowchart LR
A[Interactive message request] --> B{Message type}
B -->|Buttons| C[interactiveMessage with nativeFlowMessage]
C --> D[buildInteractiveBizNode]
B -->|List| E[listMessage with SINGLE_SELECT]
E --> F[buildListBizNode]
D --> G[sendMessageWithTyping]
F --> G
G --> H[relayMessage with additionalNodes]
H --> I[WhatsApp Web/Desktop rendering]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Hey - I've reviewed your changes and they look great!
Sourcery assessment
Needs a human reviewer. The changed PIX flow can send payment details or an incorrectly rendered payment button to WhatsApp recipients; messages already delivered cannot be recalled by reverting, though a revert stops future sends.
Author
|
Error |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📋 Description
Se corrige la renderización de botones interactivos y listas en WhatsApp Web y Desktop.
Previamente, los mensajes de botones (
buttonMessage) se envolvían en un wrapperviewOnceMessage, lo que causaba que los botones no se renderizaran correctamente en clientes web/desktop. Este cambio elimina el envoltorioviewOncey vuelve a la forma original de la stanza, inyectando el nodo biz<biz><interactive/></biz>para botones y<biz><list/></biz>para listas como nodos adicionales (additionalNodes) en el envío de mensajes.Además,
listMessageregresa al formato legado conlistType: SINGLE_SELECT, necesario para que se renderice en WhatsApp Web y Desktop (el formato moderno coninteractiveMessage+single_selectsolo funciona en móvil reciente).🧪 Type of Change
🧪 Testing
✅ Checklist
📝 Additional Notes
src/api/integrations/channel/whatsapp/helpers/interactiveMessage.helper.ts(nuevo): agregabuildInteractiveBizNode()ybuildListBizNode()para construir los nodos biz de WhatsApp.src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts:viewOnceMessagedebuttonMessage(PIX y generales).buttonMessageahora usainteractiveMessageconnativeFlowMessagee inyecta[buildInteractiveBizNode()]víaadditionalNodes.listMessageusa el formato legado (listMessage+SINGLE_SELECT) e inyecta[buildListBizNode()].additionalNodesasendMessageysendMessageWithTypingpara soportar la inyección de nodos biz.Motivo:
Corrige que los botones interactivos y listas no se renderizaran en WhatsApp Web y Desktop debido al envoltorio
viewOncey al uso del formato moderno de mensajes interactivos incompatibles con esos clientes.Summary by Sourcery
Fix WhatsApp interactive button and list delivery across web, desktop, and mobile clients.
Bug Fixes:
Enhancements:
Build: