devlikeapro / waha

WAHA - WhatsApp HTTP API (REST API) that you can configure in a click!
https://waha.devlike.pro/
Apache License 2.0
813 stars 248 forks source link

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

Closed Souhaibahar closed 2 weeks ago

Souhaibahar commented 1 month ago

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" }

devlikepro commented 1 month ago

@Souhaibahar how many chats do you have?

patron:PRO

Souhaibahar commented 1 month ago

with some accounts it was 1000 chat

devlikepro commented 2 weeks ago

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


Get all chats

Get all chats

GET /api/{session}/chats

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