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.49k stars 3.45k forks source link

When I'm logging out of WhatsApp, the "authenticated" event is being triggered. #3173

Open Esdras-Henrique3k opened 2 days ago

Esdras-Henrique3k commented 2 days ago

Is there an existing issue for this?

Describe the bug

From yesterday to today, when I started my client, every time I logged out directly on my phone, it triggered the "auth" event instead of "disconnect." With headless set to false, I can see the endless logout.

const puppeteerOptions = _.merge({ headless: false, //viewBrowser: false, //defaultViewport: null, //useChrome: false, args: [ // "--headless", "--disable-extensions", "--no-sandbox", "--disable-setuid-sandbox", "--no-first-run", // "--disable-dev-shm-usage", "--disable-accelerated-2d-canvas", "--disable-gpu", //"--single-process", ] }, config.lib.puppeteer); that.client = new Client({ //takeoverOnConflict: true, restartOnAuthFail: true, puppeteer: puppeteerOptions, authStrategy: new LocalAuth({ clientId: that.id, dataPath: that.options.connPath }), webVersionCache: { type: "remote", remotePath: https://raw.githubusercontent.com/wppconnect-team/wa-version/main/html/2.3000.1014590669-alpha.html, }, });

Expected behavior

When logging out directly on the phone, the "disconnect" event should be triggered instead of the "auth" event. The logout process should complete normally without any issues. When running in headless mode set to false, there should be no endless logout loop.

Steps to Reproduce the Bug or Issue

  1. Login in App
  2. Logout
  3. Reset client state to auth

Relevant Code

No response

Browser Type

Chromium

WhatsApp Account Type

Standard

Does your WhatsApp account have multidevice enabled?

Yes, I am using Multi Device

Environment

OS: Mac whatsapp-web.js: 1.24 Webversion: 2.3000.1014590669-alpha node: 20.5.1

Additional context

No response

sfbarragan845 commented 2 days ago

I have the same problem

s1lviuz commented 2 days ago

+1

ardhityawiedhairawan commented 1 day ago

Try this one : https://github.com/pedroslopez/whatsapp-web.js/pull/2816

Esdras-Henrique3k commented 1 day ago

Try this one : #2816

Don’t fixed, I already do that to fix other error

MoisesAlvarenga commented 1 day ago

Enfrento o mesmo problema.

giacas commented 14 hours ago

Same problem here.