pedroslopez / whatsapp-web.js

A WhatsApp client library for NodeJS that connects through the WhatsApp Web browser app
https://wwebjs.dev
Apache License 2.0
14.53k stars 3.46k forks source link

client.getState() returns CONNECTED even if phone is turned off or on flight mode. #1358

Closed Moshe-Beeri closed 11 months ago

Moshe-Beeri commented 2 years ago

Is there an existing issue for this?

Describe the bug

Switches the phone to flight mode or turned off the phone and still gets "CONNECTED" from client.getState().

Expected behavior

Expecting to get state of "TIMEOUT"

Steps to Reproduce the Bug or Issue

  1. Switch the phone to flight mode or turn off the phone.
  2. Call to client.getState().

Relevant Code

No response

Browser Type

Google Chrome

WhatsApp Account Type

WhatsApp Business

Does your WhatsApp account have multidevice enabled?

No, I am not using Multi Device

Environment

OS: Linux, Docker + Ubuntu 18 Phone OS: Android whatsapp-web.js version 1.16.4 WhatsApp Web version 2.2208.14 Node.js Version 16.14.0

Additional context

No response

victorkelvin commented 2 years ago

Multidevice isn't in BETA anymore, since then the WhatsApp pushed the new version to his services. So WhatsApp Web doesn't depend of phone connectivity to be conneceted.