waha icon indicating copy to clipboard operation
waha copied to clipboard

[NOWEB] - mark connection as offline by flag

Open devlikepro opened this issue 1 year ago • 1 comments

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 avatar Jul 03 '24 06:07 devlikepro

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

devlikepro avatar Jul 03 '24 06:07 devlikepro

+1

giovannicarella avatar Sep 10 '24 08:09 giovannicarella

+1

patron:PLUS

elasti-co avatar Sep 15 '24 10:09 elasti-co

Added in 2024.9.6


NOWEB Configuration

  • markOnline: true - send online presence when session starts (default true).
    • Required if you want to get notifications in your phone
    • Read more about ✅ Presence
{
  "name": "default",
  "config": {
    "noweb": {
      "markOnline": false,
      "store": {
        ...
      }
    }
  }
}

FAQ

👉 I don't get notifications on my phone when WAHA session is connected

  • You need to send offline after all presence you send (WhatsApp doesn't send notifications to the device if a web client is active).
  • For 🏭 NOWEB Engine also mark sure to send markOnline: false when you create a new session.

Dashboard

image

patron:PRO

devlikepro avatar Sep 18 '24 07:09 devlikepro