whatsapp-http-api
whatsapp-http-api copied to clipboard
Error when reading messages and there's a deleted message in the chat
When a user delete message the application crash
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
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" } }
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" } }