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

server crash when contact update their status [Multidevice] #1177

Closed hazeezet closed 2 years ago

hazeezet commented 2 years ago

Bug description

When there is a status update of any contact , everything crashes

Reproduction steps

Steps to reproduce the behavior:

  1. set up the client and listen to on message event.
  2. update a status of any contact saved i.e on another phone
  3. wait for the crashes ...

Expected behavior

Nothing should happen, it should receive the status update

Relevant code

Environment (please complete the following information):

WhatsApp

Library

Other

error

C:\xampp\htdocs\whastapp_js\node_modules\puppeteer\lib\cjs\puppeteer\common\ExecutionContext.js:221 throw new Error('Evaluation failed: ' + helper_js_1.helper.getExceptionMessage(exceptionDetails)); ^

Error: Evaluation failed: TypeError: Cannot read properties of undefined (reading 'canSend') at g.canReply (https://web.whatsapp.com/bootstrap_qr.4df23620fb7636625f64.js:60:442169) at Object.window.WWebJS.sendMessage (puppeteer_evaluation_script:53:31)
at ExecutionContext._evaluateInternal (C:\xampp\htdocs\whastapp_js\node_modules\puppeteer\lib\cjs\puppeteer\common\ExecutionContext.js:221:19) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async ExecutionContext.evaluate (C:\xampp\htdocs\whastapp_js\node_modules\puppeteer\lib\cjs\puppeteer\common\ExecutionContext.js:110:16) at async Client.sendMessage (C:\xampp\htdocs\whastapp_js\node_modules\whatsapp-web.js\src\Client.js:580:28)

KeruMx commented 2 years ago

the error is not when reading the status(msg), can you put all the code? I think you are using a msg.reply and it fails.

hazeezet commented 2 years ago

the error is not when reading the status(msg), can you put all the code? I think you are using a msg.reply and it fails.

This implementation failed wabot_1

Solve it by this wabot_2

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.