Sending Message and Prompt in one Dialog handler
I want to send reply message and then Prompt to the user in a single handler without waiting for user response between the two messages. For e.g. in LUISDialog, I've this for None Intent
await context.PostAsync("Hello"); PromptDialog.Confirm(context, AfterConfirming_Continue, "Do you want to continue?", "Didn't get that!", promptStyle: PromptStyle.None);
In addition to this, I've sometimes consecutive such cases. For e.g. "AfterConfirming_Continue" does the same thing i.e. has a reply and another Prompt.
This seems to work fine in emulator to the point that messages are shown in emulator in order, and responses to prompt are received by bot in order but this doesn't seem to work correctly in web chat client. I always see messages being received out of order so prompt message will appear first and then normal reply message. Plus, sometimes response to prompt is not interpreted correctly.
Any idea what is the best way to handle such cases and how to make it work with web chat client? I need to send reply message (with some attachments) followed by prompt.
You might consider using the AlwaysSendDirectToUser IBotToUser implementation
https://github.com/Microsoft/BotBuilder/blob/master/CSharp/Library/Dialogs/BotToUser.cs#L93
to make sure the same method is used to deliver all messages. if you use this implementation, you may consider waiting between the two messages as well to help ensure ordering. Overall, I don't think many channels guarantee message delivery order.
I tried using "AlwaysSendDirect_BotToUser" instead of "Conversation.SendAsync" following the EchoBot\DirectConversation example, but that doesn't seem to work either. How do you wait between two messages on bot side? Is there any notification/callback when message is send?
It seems that sending two messages or sending message followed by prompt (in order) should be common scenario, so this should be supported. Is there any other way or suggestions?
I don't believe there is any method to guarantee ordering between messages - most channels don't provide one (as you can imagine for text, email, etc). @dandriscoll are you aware of any ordering issues with the web chat control?
What's the recommended way to send multiple messages to the client in that case? Any idea if that's just a bug in web chat control?
@jigneshs123 Are you still having this issue? If so, can you provide a small code sample which reproduces this?
Closing due to inactivity, @jigneshs123 please reopen if this is still an issue. Thanks!