whatsapp-http-api icon indicating copy to clipboard operation
whatsapp-http-api copied to clipboard

Error when reading messages and there's a deleted message in the chat

Open mehmetcoskun opened this issue 2 years ago • 3 comments

When a user delete message the application crash

mehmetcoskun avatar Feb 25 '23 18:02 mehmetcoskun

Hi @mehmetcoskun! Could you provide steps to reproduce and some logs please? Do you use default engine or Venom?

I've tried to remove messages in default engine from both sides and both options (remove the message for me or for all) and none of those crashed the app.

It might happen if you want to reply on the deleted message, but it shouldn't crash the app, just give an error

allburov avatar Feb 27 '23 03:02 allburov

I didn't understand it. it works when i rebuild it. anyway now i got the below error when i get user messages

{ "statusCode": 500, "timestamp": "2023-02-27T11:51:17.619Z", "exception": { "stack": "TypeError: Cannot read properties of undefined (reading 'data')\n at /app/dist/plus/session.webjs.plus.js:51:46\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n at async WhatsappSessionWebJSPlus.getMessages (/app/dist/core/session.webjs.core.js:102:25)\n at async /app/node_modules/@nestjs/core/router/router-execution-context.js:46:28\n at async /app/node_modules/@nestjs/core/router/router-proxy.js:9:17", "message": "Cannot read properties of undefined (reading 'data')", "name": "TypeError" }, "request": { "path": "/api/messages?chatId=905555555555%40c.us&limit=100&session=default", "method": "GET", "body": {}, "query": { "chatId": "[email protected]", "limit": "100", "session": "default" } }, "version": { "version": "2022.12.11", "tier": "PLUS" } }

mehmetcoskun avatar Feb 27 '23 11:02 mehmetcoskun

And here the error when user delete message

{ "statusCode": 500, "timestamp": "2023-02-27T17:08:12.956Z", "exception": { "stack": "Error: Evaluation failed: TypeError: Cannot read properties of undefined (reading 'mediaStage')\n at __puppeteer_evaluation_script__:6:31\n at ExecutionContext._evaluateInternal (/app/node_modules/whatsapp-web.js/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:221:19)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n at async ExecutionContext.evaluate (/app/node_modules/whatsapp-web.js/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:110:16)\n at async Message.downloadMedia (/app/node_modules/whatsapp-web.js/src/structures/Message.js:387:24)\n at async WhatsappSessionWebJSPlus.getMessages (/app/dist/core/session.webjs.core.js:102:25)\n at async /app/node_modules/@nestjs/core/router/router-execution-context.js:46:28\n at async /app/node_modules/@nestjs/core/router/router-proxy.js:9:17", "message": "Evaluation failed: TypeError: Cannot read properties of undefined (reading 'mediaStage')\n at __puppeteer_evaluation_script__:6:31", "name": "Error" }, "request": { "path": "/api/messages?chatId=905555555555%40c.us&limit=10&session=default", "method": "GET", "body": {}, "query": { "chatId": "[email protected]", "limit": "10", "session": "default" } }, "version": { "version": "2022.12.11", "tier": "PLUS" } }

mehmetcoskun avatar Feb 27 '23 17:02 mehmetcoskun

Hi! Do you still see the error in the latest build?

patron:PRO

devlikepro avatar Jun 25 '24 05:06 devlikepro

2022.12.11

That's been a while :D Check 2024.6.6

patron:PRO

devlikepro avatar Jun 25 '24 05:06 devlikepro