Botframework-sdk: Error "A task was canceled" in Dashboard.

Created on 13 May 2016  路  6Comments  路  Source: microsoft/botframework-sdk

I connected my bot to Skype, Slack and Facebook Messenger. I was able to go through my dialog once in each of those applications, and then after session.endDialog() the bot didn't respond to anything and the error status appeared in the Dashboard.

What could be the cause of this?

bug

Most helpful comment

Can you share you code at all?

All 6 comments

Anyone? Please? :(

Can you share you code at all?

Alright, so I have one dialog with a long waterfall of Prompts.

bot.add('/', function (session) {
    session.beginDialog('/doDialog');
});

bot.add('/doDialog', [
    function (session) {
            builder.Prompts.choice(session, 'Choose stuff!', ['This', 'That']);
    },
....

It goes like this for a while, just Prompts after Prompts. When I reach the end of the dialog, the bot stops responding to anything and the error appears in the dashboard. I tried both session.endDialog(), session.reset() at the end of the dialog, didn't help at all.

Am I doing something wrong? I though when the dialog is over we're just back to where we started.

Is that really your root dialog code? If so it has a problem. When you call endDialog() from the second dialog your root dialogs handler is going to just get called again which would send you right back into /doDialog again. This is a trap that people seem to keep falling into so I'm thinking about making a breaking change that prevents that in a future release. In the short term you can avoid the trap by turning your root dialog into a single step waterfall. So just add array brackets around it.

If you're not comfortable sharing your actual code I understand but I really need to see the whole thing to tell you whats wrong. You can email it to me too at [email protected].

Another thing you might try is to make your second /doDialog the root dialog. If things start working that will help narrow down the issue.

Any progress on this?

Closing this issue. Please open a new issue for further discussion if necessary. Thanks!

Was this page helpful?
0 / 5 - 0 ratings