WhiskeySockets / Baileys

Lightweight full-featured typescript/javascript WhatsApp Web API
https://baileys.whiskeysockets.io/
MIT License
3.95k stars 1.34k forks source link

[BUG] #970

Open joaosvc opened 2 months ago

joaosvc commented 2 months ago

Describe the bug When trying to send a message to a group with many users, the message takes a long time to be sent

To Reproduce Steps to reproduce the behavior:

  1. I sent any message in a group with many users, about 1,000 people

Expected behavior Faster shipping, such as privately or in small groups of less than 10 people

Additional context I briefly analyzed the code for sending a message, and apparently it executes a for between the users in the group, and with each message sent it freezes the for until the message is sent. I imagine that's the problem.

DaniloAzevedo commented 2 months ago

Any news ?

joaosvc commented 1 month ago

Any news ?

Not yet, the best I could do was look at the library, and I realized that when sending the first message it counts all the members of the group and then adds it to the cache, this data is used to send the message in the group, so the delay is only the first time.