botframework-sdk icon indicating copy to clipboard operation
botframework-sdk copied to clipboard

ConnectorBot in Waterfall model, unable to go back to Waterfall Step2

Open officialdharam opened this issue 10 years ago • 10 comments

So, I have a Connector Bot and Slack integration. The Bot talks to LUIS. One of my Intents is to UpdateAddress, which is implemented in a waterfall fashion. Here is an example.

Me: Please update the shipping address. Bot: What do you want me to update it to? Me: Hyderabad Bot: Sorry! I didn't understand

Now, the exact same code in a Text Bot works and my conversation ends well.

Here is the difference I found after logging some statements: In Text Bot, the dialog data for both the statement is: {"BotBuilder.Data.Group":"BotBuilder.Id.DefaultGroup","BotBuilder.Data.Intent":"UpdateAddress","BotBuilder.Data.WaterfallStep":0}

{"BotBuilder.Data.Group":"BotBuilder.Id.DefaultGroup","BotBuilder.Data.Intent":"UpdateAddress","BotBuilder.Data.WaterfallStep":1}

For Connector Bot it is:

{"BotBuilder.Data.Group":"BotBuilder.Id.DefaultGroup","BotBuilder.Data.Intent":"UpdateAddress","BotBuilder.Data.WaterfallStep":0}

{"BotBuilder.Data.Group":"BotBuilder.Id.DefaultGroup","BotBuilder.Data.Intent":"None"}

Is there a bug in the Connector bot?

My bot name is restserverbot

Here is the relevant part of the code snippet:

Dialog for Intent UpdateAddress

dialog.on('UpdateAddress', 
[
    function (session, args) {
        console.log(JSON.stringify(session.dialogData));     
        builder.Prompts.text(session, "What is the new address you want me to update to?");
    },    
    function (session, results) {
        console.log(JSON.stringify(session.dialogData));
        if (results.response) {
            session.userData.newAddress = results.response;
            session.send('Address Updated');
        }   
    }
]
);

// Dialog for Intent: None

dialog.on('None', function (session, args) {
    console.log(JSON.stringify(session.dialogData));
    session.send("Sorry! I didn't understand"); 
});

officialdharam avatar May 11 '16 13:05 officialdharam

I would definitely expect the same behavior on both. Have you tried using the emulator?

Stevenic avatar May 11 '16 20:05 Stevenic

Yes! I have tried the emulator, the behavior is same as I described in the bug. Here is a screenshot of the conversation.

image

officialdharam avatar May 12 '16 05:05 officialdharam

Could you update to v0.10.0 and see if it still reproduces. I did just rewrite most of the code for the builtin prompts.

Stevenic avatar May 12 '16 06:05 Stevenic

Ok! I tried updating the builder's version to 0.10.0. I am afraid, it behaves the same. Here is the JSON responses from the emulator.

responses.txt

officialdharam avatar May 12 '16 12:05 officialdharam

Anyway you can send me an actual code file that repro's the problem? I can track it down and fix the issue pretty quickly. Since we're dealing with a LUIS model here you're welcome to email me the code at [email protected]

Stevenic avatar May 12 '16 17:05 Stevenic

Hey Steven! I have tested with two channels, Skype and Slack. Slack is giving me trouble whereas Skype behaves appropriately.

Thanks for looking into though. I can proceed with Skype, so if you want, you can look at this at your own convenience.

officialdharam avatar May 13 '16 12:05 officialdharam

I actually just looked back through the responses.txt and I notice that when you reply to the prompt in the emulator your callstack is completely gone when the bot replies. This is likely an indication that your code is throwing an exception somewhere. Have you tried debugging with break on all exceptions turned on?

Stevenic avatar May 13 '16 14:05 Stevenic

I see! No I haven't tried debugging with break on all exceptions on. But again, it is really strange that the behavior in Skype is different than the ones in Slack and Emulator.

I will try debugging with the flag on as you suggested and keep you posted with the update.

officialdharam avatar May 13 '16 15:05 officialdharam

Any luck?

Stevenic avatar May 20 '16 01:05 Stevenic

Could you please re-open if you're still having an issue.

Stevenic avatar Jun 01 '16 08:06 Stevenic