When calling await this.client.getContacts(), the method returns duplicate contacts with the same name. One contact has the correct number, while the other (or multiple) contact(s) have numbers with an @lid suffix. This often results in more than two entries for the same contact, which seems incorrect.
Expected behavior
Only one entry should be returned for each contact, with the correct number (without the @lid suffix). Duplicate contacts with the same name but different number formats should not be included.
Steps to Reproduce the Bug or Issue
Call the getContacts() method:
const contacts = await this.client.getContacts(); console.log(contacts);
Observe that some contacts are returned multiple times with the same name:
One contact has the correct phone number format.
Other contacts have the same name but their numbers include the @lid suffix.
Example:
[ { "id": "123456789@c.us", "number": "123456789", "name": "John Doe" }, { "id": "123456789@lid", "number": "123456789", "name": "John Doe" } ]
Relevant Code
No response
Browser Type
Chromium
WhatsApp Account Type
Standard
Does your WhatsApp account have multidevice enabled?
Yes, I am using Multi Device
Environment
whatsapp web js: [pedroslopez/whatsapp-web.js#webpack-exodus]
Node.js Version: [v21.7.2]
Operating System: [Windows]
Is there an existing issue for this?
Describe the bug
When calling
await this.client.getContacts(),
the method returns duplicate contacts with the same name. One contact has the correct number, while the other (or multiple) contact(s) have numbers with an @lid suffix. This often results in more than two entries for the same contact, which seems incorrect.Expected behavior
Only one entry should be returned for each contact, with the correct number (without the @lid suffix). Duplicate contacts with the same name but different number formats should not be included.
Steps to Reproduce the Bug or Issue
Call the getContacts() method:
const contacts = await this.client.getContacts(); console.log(contacts);
Observe that some contacts are returned multiple times with the same name: One contact has the correct phone number format. Other contacts have the same name but their numbers include the @lid suffix. Example:[ { "id": "123456789@c.us", "number": "123456789", "name": "John Doe" }, { "id": "123456789@lid", "number": "123456789", "name": "John Doe" } ]
Relevant Code
No response
Browser Type
Chromium
WhatsApp Account Type
Standard
Does your WhatsApp account have multidevice enabled?
Yes, I am using Multi Device
Environment
whatsapp web js: [pedroslopez/whatsapp-web.js#webpack-exodus] Node.js Version: [v21.7.2] Operating System: [Windows]
Additional context
No response