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

[BUG][WEBJS] - Error sending text to half of Brazilian numbers (every number registered before 2012). #238

Closed
arielpts opened this issue Dec 1, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@arielpts
Copy link

arielpts commented Dec 1, 2023

Describe the bug

About 5 years ago, numbers in Brazil had the format 99 9999-9999.
Due to the increasing number of numbers, a ninth digit was added and became 99 9 9999-9999.
If I use the api to send a message to a number with the new digit and the account was initially registered without the ninth digit, the message is not delivered. I send an image to exemplify.

Note in the image that if I send it to the new number with the ninth digit, the message is not delivered.
This creates a difficulty, as everyone passes the number with the ninth digit, but when sending the message using the api, it is not delivered.

It's impossible to know if the number was registered in WA with or without the 9th digit and via the current API. The mobile app (and the web version as well) translates to the correct user id automatically.

Version

{
  "version": "2023.12.1",
  "engine": "WEBJS",
  "tier": "CORE",
  "browser": "/usr/bin/chromium"
}

To Reproduce Steps to reproduce the behavior:

  1. Just find someone with an old Brazilian account (you can use mine, sent on Patreon messages). I will love to receive test messages and will read & reply to confirm. Just send a text "testing WhatsApp"or smth and I will understand.
  2. Try to send a message to the number with the new digit.
  3. The message will not arrive

Expected behavior

The message should be sent. A workaround can be applied in the /api/contacts/check-exists endpoint that can return the user id

Screenshots
Screenshot 2023-12-01 at 18 01 40

Additional context

@arielpts arielpts added the bug Something isn't working label Dec 1, 2023
@allburov
Copy link
Contributor

allburov commented Dec 2, 2023

Hi!

A workaround can be applied in the /api/contacts/check-exists endpoint that can return the user id

I love the suggested workaround, the fix is available in 2023.12.2 PLUS version (will be available in CORE in the next release).
Checked it with provided phone number - it does add remove one 9 from the phone number.

GET /api/contacts/check-exists?phone=11231231231&session=default
{
  "numberExists": true,
  "chatId": "123123123@c.us"
}

Added a note about Brazilian phone numbers here:


Note for Brazilian Phone Numbers

You should use the GET /api/contacts/check-exists endpoint before sending a message to a new phone number
to get the correct chatId because of the additional 9-digit number added after 2012.

It's fine to send the response to chatId for incoming messages, though - the payload already has the correct chatId.


<off-topic>
About a year ago I wished to have detailed issues in the repo... My dream came true, it's a New Year gift! 😆
#27 (comment)

Thank you @arielpts for the such detailed issue, it's pleasure to see and fix that - you've done all work yourself, so it's safe to assume you've fixed the issue 👍
Obrigado!
</off-topic>

@allburov allburov closed this as completed Dec 2, 2023
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

2 participants