New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Application crashes when replying to a revoked message #2956
Comments
Same here |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
Wrap it in |
as i said before :
i already tried this in a the only workaround im using was sending the message using what i asking is, is there's a way to provide a status check if the message is already revoked by the user in the middle of trying to reply the message, rather than crash away. |
Is there an existing issue for this?
Describe the bug
im trying to integrate chatgpt into whatsapp. When a user revokes their message in the middle of processing the reply, the application crashes with this error
home/joysky/ayanaboat/node_modules/whatsapp-web.js/node_modules/puppeteer-core/lib/cjs/puppeteer/common/ExecutionContext.js:229
throw new Error('Evaluation failed: ' + (0, util_js_1.getExceptionMessage)(exceptionDetails));
^
Error: Evaluation failed: TypeError: Cannot read properties of undefined (reading 'unsafe')
at window.WWebJS.sendMessage (pptr://puppeteer_evaluation_script:38:67)
at pptr://puppeteer_evaluation_script:10:45
at ExecutionContext._ExecutionContext_evaluate (/home/joysky/ayanaboat/node_modules/whatsapp-web.js/node_modules/puppeteer-core/src/common/ExecutionContext.ts:294:13)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at ExecutionContext.evaluate (/home/joysky/ayanaboat/node_modules/whatsapp-web.js/node_modules/puppeteer-core/src/common/ExecutionContext.ts:137:12)
at Client.sendMessage (/home/joysky/ayanaboat/node_modules/whatsapp-web.js/src/Client.js:938:28)
Node.js v18.17.1
error: script "start" exited with code 1 (SIGHUP)
i already tried to wrap the
message.reply
into try catch statement. its still crash. i also tried to print themessage.rawData
after the chatgpt finished proceesing the response and the user message is revoked. themessage.type
still returnedchat
, notrevoked
Expected behavior
The application should not crash when a user revokes their message. Ideally, the library should provide a way to check if a message has been revoked in the middle of processing the replies before trying to reply to it.
Steps to Reproduce the Bug or Issue
Relevant Code
Browser Type
Chromium
WhatsApp Account Type
Standard
Does your WhatsApp account have multidevice enabled?
Yes, I am using Multi Device
Environment
OS: Ubuntu 20.04
Phone OS: Android 14
whatsapp-web.js version: latest#webpack-exodus
whatsapp web version: 2.3000.1012770224
node.js version: v18.17.1
Additional context
No response
The text was updated successfully, but these errors were encountered: