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

[Question] Is context.Done really completing the dialog in the scenario of a ResumeAsync happening?

Open ejadib opened this issue 10 years ago • 1 comments

I have a Chain like this:

return Chain.PostToChain()
                .ContinueWith<Message, string>(async (ctx, message) {
                    var msg = await message;

                    return Chain.ContinueWith<string, string>(new AuthDialog(msg), AuthDialogContinuation);
                })
                .ContinueWith<string, string>(OrderDialogCallback)

The AuthDialog is a dialog very similar to the SimpleFacebookAuthDialog. I have a Web API where the ResumeAsync method is being called (with a ResumptionCookie and a msg with the token) to resume the conversation. As expected, the conversation is resumed and the MessageReceivedAsync method of the AuthDialog is called. The logic there is pretty much the same than the one in the SimpleFacebookAuthDialog and I'm also doing a context.Done like here.

What I'm seeing is that even that the context.Done is being called and the Continuation is happening, when I send a new message it goes through the MessageReceivedAsync of the AuthDialog. I was expecting to actually go straight to the second dialog since the first one was already completed. After this, if I send another message (and so another context.Done is called in the AuthDialog), it works as expected (not going through the MessageReceivedAsync of the AuthDialog).

Interestingly enough, if instead of resuming the conversation via the Auth Flow, I just send a message with the expected format ("token:123343") the context.Done works as expected, so it seems clearly related to the resumption.

Any idea how to overcome this?

ejadib avatar May 13 '16 03:05 ejadib

Closing this for now as I think what is happening here is something else.

ejadib avatar May 13 '16 19:05 ejadib