You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.
I am trying to leave all the existing dialogs from within an handler; checking if the user really wishes to leave, then I call await bot.cancelAllDialogs() in the handler.
I am getting the following error at runtime:
(node:76242) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'state' of undefined
at BotkitConversation.<anonymous> (/Users/etienne/Code/botkit-example/node_modules/botkit/lib/conversation.js:617:62)
at Generator.next (<anonymous>)
at /Users/etienne/Code/botkit-example/node_modules/botkit/lib/conversation.js:7:71
at new Promise (<anonymous>)
at __awaiter (/Users/etienne/Code/botkit-example/node_modules/botkit/lib/conversation.js:3:12)
at BotkitConversation.end (/Users/etienne/Code/botkit-example/node_modules/botkit/lib/conversation.js:614:16)
at BotkitConversation.<anonymous> (/Users/etienne/Code/botkit-example/node_modules/botkit/lib/conversation.js:558:35)
at Generator.next (<anonymous>)
at fulfilled (/Users/etienne/Code/botkit-example/node_modules/botkit/lib/conversation.js:4:58)
at process._tickCallback (internal/process/next_tick.js:68:7)
After some investigation, I found that the end() method in the BotkitConversation class uses dc.activeDialog which has been nulled by cancelAllDialogs(). Hence, the crash.
@etiennellipse hey, did you find any solution or workaround for this?
etiennellipse
changed the title
bot.cancelAllDialogs() called inside an handler causes a crash
bot.cancelAllDialogs() called inside a dialog handler causes a crash
Oct 25, 2019
I am trying to leave all the existing dialogs from within an handler; checking if the user really wishes to leave, then I call
await bot.cancelAllDialogs()
in the handler.I am getting the following error at runtime:
After some investigation, I found that the end() method in the BotkitConversation class uses
dc.activeDialog
which has been nulled by cancelAllDialogs(). Hence, the crash.Here is the code example for reproduction:
Context:
The text was updated successfully, but these errors were encountered: