Skip to content

Commit 250ddd2

Browse files
committed
fix(chatwoot): improve jid normalization and type safety in chatwoot integration
Refactor to preserve LID identifiers and update parameter type for better type safety as per code review feedback.
1 parent bee309c commit 250ddd2

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1609,7 +1609,7 @@ export class BaileysStartupService extends ChannelStartupService {
16091609
// This enables LID to phoneNumber conversion without breaking existing webhook consumers
16101610

16111611
// Helper to normalize participantId as phone number
1612-
const normalizePhoneNumber = (id: string | any): string => {
1612+
const normalizePhoneNumber = (id: string | null | undefined): string => {
16131613
// Remove @lid, @s.whatsapp.net suffixes and extract just the number part
16141614
return String(id || '').split('@')[0];
16151615
};

src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2527,7 +2527,7 @@ export class ChatwootService {
25272527
}
25282528
}
25292529

2530-
public getNumberFromRemoteJid(remoteJid: string) {
2530+
public normalizeJidIdentifier(remoteJid: string) {
25312531
if (!remoteJid) {
25322532
return '';
25332533
}

0 commit comments

Comments
 (0)