From 5cb53488f38d50ee74100f0a3e6fe2ed6ba9c260 Mon Sep 17 00:00:00 2001 From: MohaDevPro <67959289+MohaDevPro@users.noreply.github.com> Date: Thu, 5 Mar 2026 15:24:56 +0300 Subject: [PATCH 1/2] fix(whatsapp): resolve this.isZero error in list messages by removing destructive JSON cloning --- .../channel/whatsapp/whatsapp.baileys.service.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts index 60e857fcc..86ea5bd9a 100644 --- a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts +++ b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts @@ -678,14 +678,10 @@ export class BaileysStartupService extends ChannelStartupService { if ( message.deviceSentMessage?.message?.listMessage?.listType === proto.Message.ListMessage.ListType.PRODUCT_LIST ) { - message = JSON.parse(JSON.stringify(message)); - message.deviceSentMessage.message.listMessage.listType = proto.Message.ListMessage.ListType.SINGLE_SELECT; } - if (message.listMessage?.listType == proto.Message.ListMessage.ListType.PRODUCT_LIST) { - message = JSON.parse(JSON.stringify(message)); - + if (message.listMessage?.listType === proto.Message.ListMessage.ListType.PRODUCT_LIST) { message.listMessage.listType = proto.Message.ListMessage.ListType.SINGLE_SELECT; } From 034619cba5f2868c29bbc79bdbfcf7693e26d7e2 Mon Sep 17 00:00:00 2001 From: MohaDevPro <67959289+MohaDevPro@users.noreply.github.com> Date: Thu, 5 Mar 2026 15:37:18 +0300 Subject: [PATCH 2/2] refactor: extract listType normalization into a helper function --- .../whatsapp/whatsapp.baileys.service.ts | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts index 86ea5bd9a..b98a712b9 100644 --- a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts +++ b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts @@ -224,6 +224,12 @@ async function getVideoDuration(input: Buffer | string | Readable): Promise