whatsapp-http-api icon indicating copy to clipboard operation
whatsapp-http-api copied to clipboard

[BUG][WEBJS] - get /api/session/chats takes too long

Open Souhaibahar opened this issue 9 months ago • 2 comments

Hello

Getting contacts chat intially ( not messages but just chats call ) take soo soo long in the first time . When i call Chats after scanning QR

It takes between 2 min to even 8 min for some users. Is that normal, and is there away i can spend things ? , or someway to only load like the last 100 recent , and then request the rest. I would love any idea that can help . This is only for initial load , as after that it's acceptable as all chats returned less than minute , for that first one it takes too much . I event had to increase HttpClient.Timout , because it times out before returns response

I would apperciate any advice

Version { "version": "2024.5.6", "engine": "WEBJS", "tier": "PLUS", "browser": "/usr/bin/google-chrome-stable" }

Souhaibahar avatar May 13 '24 13:05 Souhaibahar

@Souhaibahar how many chats do you have?

patron:PRO

devlikepro avatar May 20 '24 05:05 devlikepro

with some accounts it was 1000 chat

Souhaibahar avatar May 20 '24 14:05 Souhaibahar

Added limit and offset parameters to GET /api/{session}/chats endpoint.

  • Read more about Get all chats
  • Build: 2024.6.4
  • Engine: WEBJS
  • Engine: NOWEB

Get all chats

Get all chats

GET /api/{session}/chats
  • limit - limit the number of chats to return
  • offset - skip the number of chats from the start

If you see timeout or the request takes too long - consider using limit parameter to get chats in smaller chunks

GET /api/{session}/chats?limit=100&offset=0

patron:PRO

devlikepro avatar Jun 17 '24 04:06 devlikepro