Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

contact.isMyContact is very variable, sometimes true and sometimes false #2988

Closed
1 task done
lhj502819 opened this issue Apr 25, 2024 · 2 comments
Closed
1 task done
Labels
bug Something isn't working

Comments

@lhj502819
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

Hey,

when i try to get any informations about a contact via getContactById which i messaged first (number in phone book, I've already added a contact) The value of isMyContact is very variable, sometimes true and sometimes false.

Am I doing something wrong or is this a known bug? Or is there a better way to tell if this id has been added as a contact?

Thanks in advance!

Function:

let contact= await client.getContactById("[email protected]");
console.log(contact);

Expected behavior

isMyContact=true

Steps to Reproduce the Bug or Issue

By executing the following code(xxxx is the number of my contact person):

let contact= await client.getContactById("[email protected]");
console.log(contact);

Relevant Code

let contact= await client.getContactById("[email protected]");
console.log(contact);

Browser Type

Chromium

WhatsApp Account Type

Standard

Does your WhatsApp account have multidevice enabled?

Yes, I am using Multi Device

Environment

OS:Windows
Phone Os:Android
whatsapp-web.js:1.23.0
WhatsApp Web version:2.2412.54
Node.js Version:v20.11.1

Additional context

No response

@lhj502819 lhj502819 added the bug Something isn't working label Apr 25, 2024
@made-777
Copy link

when i try to get any informations about a contact via getContactById which i messaged first (number in phone book, I've already added a contact) The value of isMyContact is very variable, sometimes true and sometimes false.

Am I doing something wrong or is this a known bug? Or is there a better way to tell if this id has been added as a contact?

you have to open and close the script
to get new data, because contact synchronization doesn't work on WhatsApp web
i also use function getContactById to sync people api

@lhj502819
Copy link
Author

lhj502819 commented Apr 30, 2024

when i try to get any informations about a contact via getContactById which i messaged first (number in phone book, I've already added a contact) The value of isMyContact is very variable, sometimes true and sometimes false.
Am I doing something wrong or is this a known bug? Or is there a better way to tell if this id has been added as a contact?

you have to open and close the script to get new data, because contact synchronization doesn't work on WhatsApp web i also use function getContactById to sync people api

@made-777 Which api do you use to synchronize contact data on Whatsaapp web?use client.getContactById? thy

@alechkos alechkos closed this as completed May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants