canove / whaticket-community

A very simple Ticket System based on WhatsApp messages, that allow multi-users in same WhatsApp account.
MIT License
1.55k stars 795 forks source link

Error when receiving files after whatsapp web update #529

Closed allgood closed 1 year ago

allgood commented 1 year ago

This morning after a reboot on the server that was running whaticket the files attachments stopped working. On the logs I could get this error:

ERROR: Error handling whatsapp message: Err: Error: Evaluation failed: TypeError: window.Store.DownloadManager.downloadAndDecrypt is not a function
   |     at __puppeteer_evaluation_script__:20:75
   | Error: Evaluation failed: TypeError: window.Store.MediaPrep.prepRawMedia is not a function
   |     at window.WWebJS.processMediaData (__puppeteer_evaluation_script__:235:50)
   |     at async window.WWebJS.sendMessage (__puppeteer_evaluation_script__:19:19)
   |     at async __puppeteer_evaluation_script__:10:25
   |     at ExecutionContext._evaluateInternal (/usr/src/app/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:221:19)
   |     at processTicksAndRejections (internal/process/task_queues.js:95:5)
   |     at async ExecutionContext.evaluate (/usr/src/app/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:110:16)
   |     at async Client.sendMessage (/usr/src/app/node_modules/whatsapp-web.js/src/Client.js:686:28)
   | WARN:
   |     message: "ERR_SENDING_WAPP_MSG"
   |     statusCode: 400
   | [1679938309289] ERROR: Error handling whatsapp message: Err: Error: Evaluation failed: TypeError: window.Store.DownloadManager.downloadAndDecrypt is not a function
  |     at __puppeteer_evaluation_script__:20:75

Investigated a little and found that this is related with a whatsapp web update and was already addressed by whatsapp-web.js issue pedroslopez/whatsapp-web.js#2078 and is fixed on release 1.19.5