chrishubert / whatsapp-api

This project is a REST API wrapper for the whatsapp-web.js library, providing an easy-to-use interface to interact with the WhatsApp Web platform.
https://www.christophehubert.com
Other
810 stars 373 forks source link

Slow response time when sending URL via SendMessage API #277

Open Martin22 opened 1 week ago

Martin22 commented 1 week ago

Hi. If I send a URL, for example, https://google.com/, as a string via the SendMessage API endpoint, I experience a 7-second delay before the curl command completes. The same issue occurs when using Swagger. It seems like it's trying to resolve the domain via DNS. However, DNS resolution works everywhere else, both in Docker and on the host machine, so it doesn’t appear to be a DNS problem. Has anyone else encountered this issue?

aviamsuni commented 1 week ago

I also sometimes have a slow response time of up to several hours late, and not only when sending an address

Martin22 commented 1 week ago

I figured out why there is a delay. The application on the phone must be running, through which the page previews are likely being fetched. If it's not running, it seems to wait for some kind of timeout, and the preview of the sent page won't load. It looks like a feature of WhatsApp, which probably can't be changed, but maybe the timeout could be shortened somehow?

avoylenko commented 2 days ago

Should be fixed, pull the latest image. The bug https://github.com/pedroslopez/whatsapp-web.js/issues/3167