From b30dc5e4a11515f169ef30612dec61a510b08eae Mon Sep 17 00:00:00 2001 From: Patrick Metzner Morais Date: Fri, 23 Oct 2026 01:25:01 -0300 Subject: [PATCH] fix(baileys): check messageContextInfo as an own property in getBase64FromMediaMessage protobufjs declares every field on the prototype, so 'messageContextInfo' in msg.message is true for any Baileys message and the guard skipped every message left with one own key after the MessageSubtype unwrap. A captioned document (documentWithCaptionMessage) was therefore never uploaded to S3 and, in messages.upsert, never reached the webhook. --- .../channel/whatsapp/whatsapp.baileys.service.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts index 22839fd451..50dc44bdcc 100644 --- a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts +++ b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts @@ -4346,7 +4346,10 @@ export class BaileysStartupService extends ChannelStartupService { } } - if ('messageContextInfo' in msg.message && Object.keys(msg.message).length === 1) { + if ( + Object.keys(msg.message).length === 1 && + Object.prototype.hasOwnProperty.call(msg.message, 'messageContextInfo') + ) { this.logger.verbose('Message contains only messageContextInfo, skipping media processing'); return null; }