devlikeapro / waha

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

[NOWEB] - mark connection as offline by flag #412

Open devlikepro opened 2 days ago

devlikepro commented 2 days ago

The request from Discord https://discord.com/channels/1228605717372604466/1228639621391585354/1256952165516185690


I'm using NOWEB... and I want my users to receive notifications on their devices... so I call /api/{session}/presence with { "presence": "offline" } as soon as I receive the WORKING status. It works fine sometimes... but sometimes when the session receives a message, it goes back online.

Would it be safe to set presence to offline after each message the session receives? Or am I doing something wrong? Each server I have hosts around >300 NOWEB sessions... and they might receive a lot of messages... so it's going to be way too many presence offline requests... no? Is there a chance of getting a number blocked by too many presence offline requests?

patron:PRO

devlikepro commented 2 days ago

We recently added "reconnect session after 30 minutes" behaviour, and at the start it does send "online" status always. We'll fix that, but likely you'll need to add a new flag markOnline: false when running a session.

patron:PRO