From d76816eb9cccb08be36cef9a210bc6ea9ed66e6e Mon Sep 17 00:00:00 2001 From: Davidson Gomes Date: Wed, 17 Jul 2024 18:49:39 -0300 Subject: [PATCH] Fix: Resolve 'not find name' issue in WhatsApp service Resolves an issue where a name was not being found in the WhatsApp service. This fix updates the 'name' property in the WhatsApp service to use 'remoteJid' instead of 'id' when searching for contacts. This change affects the 'src/api/services/channels/whatsapp.baileys.service.ts' file and is reflected in the latest CHANGELOG.md update. Note: The 'not find name' issue was initially addressed in the previous CHANGELOG.md version but was reintroduced due to a change in the contacts search logic. This commit aims to definitively resolve the issue. --- CHANGELOG.md | 2 +- src/api/services/channels/whatsapp.baileys.service.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 68ff4ef1..452301c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,13 +3,13 @@ ### Fixed * Fixed the function of saving or not saving data in the database +* Resolve not find name # 2.0.1-beta (2024-07-17 17:01) ### Fixed * Resolved issue with Chatwoot not receiving messages sent by Typebot -* Fixed the function of saving or not saving data in the database # 2.0.0-beta (2024-07-14 17:00) diff --git a/src/api/services/channels/whatsapp.baileys.service.ts b/src/api/services/channels/whatsapp.baileys.service.ts index 87f7d811..db27ac12 100644 --- a/src/api/services/channels/whatsapp.baileys.service.ts +++ b/src/api/services/channels/whatsapp.baileys.service.ts @@ -2669,7 +2669,7 @@ export class BaileysStartupService extends ChannelStartupService { return { exists: !!numberVerified?.exists, jid: numberJid, - name: contacts.find((c) => c.id === numberJid)?.pushName, + name: contacts.find((c) => c.remoteJid === numberJid)?.pushName, number: user.number, }; }),