[NodeJS] ERROR: Too many calls to session.endDialog()
See original GitHub issueI’ve been refactoring our full Botkit
code to botbuilder
this past days and so far it has been and it has been great in taking a major load of the code in managing dialogs (-ues).
I’m currently working with v0.9.x
, and while its been great, I’d like to ask on why and what plans are ahead on the ERROR: Too many calls to session.endDialog().
-response I get when an error is thrown within the code.
Reason being, it doesn’t give me any meaningful idea on what caused the issue. Are there any tips or commands I’m missing?
Thanks! #
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top Results From Across the Web
[NodeJS] ERROR: Too many calls to session.endDialog() #167
So the other issue I noticed is with your respondToSpecificFoo() function. You call session.endDialog() which of itself is fine. It will pop ...
Read more >node.js - ERROR: Too many calls to session.endDialog() with MS ...
I have having a play with this to create one for a fictional utility company, and looking at using LUIS to interpret my...
Read more >Errors | Node.js v19.3.0 Documentation
Errors that occur within Asynchronous APIs may be reported in multiple ways: Most asynchronous methods that accept a callback function will accept an...
Read more >Microsoft/BotBuilder - Gitter
I also see in the console: ERROR: Too many calls to session.endDialog(). but im not making ANY calls to endDialog. ideas? Alex Sorokoletov....
Read more >Database Engine events and errors - SQL Server
Too many table names in the query. The maximum allowable is %d. 107, 15, No, The column prefix '%.*ls' does not match with...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
So the other issue I noticed is with your
respondToSpecificFoo()
function. You call session.endDialog() which of itself is fine. It will pop that dialog off the stack and return control to the dialog you came from (think of it as calling close window.) The issue is in your async callback forSomeApi.getSpecificFoo()
you’re then callingsession.send()
. I’m assuming this is working ok but it’s a little dangerous.The reason why its dangerous is that you’ve already ended your dialog (closed the window) and now you’re trying to say stuff in that context. In most cases nothing overly bad is going to happen, especially with
send()
but say you tried to callbeginDialog()
instead, you would totally jackup your callstack. So as a best practice you should avoid doing stuff like this. So how to do this the right way? You should move yourendDialog()
call into your callback and combine it with thesend()
:@Stevenic Thank you for tip. I’ve changed the code and yes, it does go away so far.
I’ll go ahead and make changes to our code accordingly if any, and await for a new release. Thanks! 😃