userData properties not set when dialog starts automatically
Hi,
I am settting some properties in my 'start' dialog and when the bot starts this dialog automatically these properties are not set. This is a problem since in the start dialog I am emptying the session data so everything can start fresh. The only solution is to restart manually by typing the trigger keyword that starts 'start' dialog.
This is how the dialog is started automatically:
bot.on('conversationUpdate', function (message) {
if (message.membersAdded) {
if (message.source != 'skypeforbusiness') {
message.membersAdded.forEach(function (identity) {
if (identity.id === message.address.bot.id) {
bot.beginDialog(message.address, 'start');
}
});
}
}
});
Conversation Update is sent by the direct line connector once when the bot joins the conversation, and once when the user joins the conversation. In the emulator, these are both sent immediately (not the same behavior of the direct line connector). Using WebChat or directline, the bot's ConversationUpdate is sent when the conversation is created and the user's ConversationUpdate is sent when they first send a message. When ConversationUpdate is sent, there isn't enough information in the message to construct the dialog stack... this means that prompts and dialogs do not work correctly as a response to ConversationUpdate. There is a workaround you can use described here: https://github.com/Microsoft/BotBuilder/issues/4245#issuecomment-369311452