SDK Version: Latest
Channels : WebChat & Emulator
Development Environment: LOCALHOST
I have a simple bot created to send a welcome message with menu selection using adaptivecard as activity attachment. I'm using the ConversationUpdate event to send this welcome message. Now, once user click on any menu item it's always coming as "ConversationUpdate" activity type in the message controller in the API. Issue is with the webchat. Emulator working fine and its coming as "Message" activity type.
WebChat should send it as a AcivityType.Message Event when user reponds as the same way as it working in emulator
Please share your code.
Here is the code : https://github.com/sowsan/Bot/tree/master/Bot-Demo/Bot-Demo
@sowsan we are looking into this. Something is wrong and we are trying to pinpoint exactly what it is.
@msft-shahins, can you please have a look?
I had submitted it in bot webchat as well : https://github.com/Microsoft/BotFramework-WebChat/issues/498
@sowsan I have been tinkering around with your code for the past 2 days. I was able to get the card and the response to show up in both the webchat and the emulator channels.
I moved your code around but didn't really change much. Do you have a use case for trying to handle conversationUpdates in a dialog rather than the message controller? I ask because I moved the code from the dialog to the controller and I am not sure if that's how you needed it or not. Please give it a try and see how it works for you
side note. In webchat control. When I launch the application from visual studio the card does not appear the first time, but when I refresh it does. If I copy and paste the URL into a browser window (as a customer would) it also works. that was the only quirky behavior I found. Let me know how this works out for you Good Luck.
@JasonSowers can you try this on other channels to see if this is a universal or specific to webchat?
@danmarshall Will do
@JasonSowers thank you. Yes, I have the same issue with the ActivityType.Event. My bot has a functionality to send the proactive messages and I'm doing it today with the Azure fucntions to send the messages. In that case I send a adapative card to the user from the dialogue and I'm getting the same issue there too. So, I thought that if we can fix it in the dialogue then it will fix my other issue as well.
tested with bot emulator & web chat. Issue seen only with webchat
@sowsan tested my modified code? or the original?
Thanks @sowsan . Can you specify how you are using WebChat:
@dandriscoll , both 1&2
@sowsan can you provide your bot id ?
@JasonSowers i was able to fix it by putting the code in the messagecontroller like you did, but in my case I have to execute it via the dialogue. Thanks again !
@dandriscoll , are u looking for this ? https://dev.botframework.com/bots/settings?id=testbot2013 , currently the api is not deployed, let me know. You can also look at the code that I was able to reproduce it here. https://github.com/sowsan/Bot/tree/master/Bot-Demo/Bot-Demo
@sowsan are you still having trouble with this, or have you resolved it? Going to close this issue, but feel free to reopen if you would like to continue the conversation.
@JasonSowers yes, still its an issue. Anyone was able to reproduce the issue and find a resolution ?
Between, I was able to reproduce the issue with DirectLine Channel as well , so its just webchat, I think webchat is also using DirectLine so it might be DirectLine related.
Anyone facing the same issue ? its a real blocker to one of my projects now :(
@sowsan it would be very helpful to me if you can deploy this bot so that I can run WebChat against it.
currently its privately tested , is this enough ? https://dev.botframework.com/bots?id=uChat
@sowsan - Yes I was able to see it.
currently im testing that one and whenever I send a proactive message (ActivityType.Trigger) it shows the reminder dialogue and waiting there. Now, once I send any further messages its going as "ConversationUpdate" Type.
@sowsan - please see #2093
You should expect to see at least 2 ConversationUpdates : first for the bot being added to the conversation, second for the user being added. I believe that the initial button click from the user is the signal that they have entered the conversation.
To avoid being triggered by either, compare the conversation.MembersAdded[i].Id to see which of the 2 ConversationUpdates is happening.
@sowsan Here is a sample of what @danmarshall is talking about
else if (message.Type == ActivityTypes.ConversationUpdate)
{
IConversationUpdateActivity iConversationUpdated = message as IConversationUpdateActivity;
if (iConversationUpdated != null)
{
foreach (var member in iConversationUpdated.MembersAdded ?? System.Array.Empty<ChannelAccount>())
{
// if the bot is added, then
if (member.Id == iConversationUpdated.Recipient.Id)
{
//do stuff
}
}
}
}
Thanks, I have already added it in the dialogue code, look like i have to go without dialogue and which is something not a good work around for me.
You can close this issue as I was able to work around it using this model : https://github.com/Microsoft/BotBuilder-Samples/tree/master/CSharp/core-proactiveMessages
Basically I have implemented a different API endpoint to send the proactive reminders instead of another direct client using Azure Function. Because of that I'm not getting any conversationupdated event in the current dialogue and I'm good to stay with the dialogue model. Thanks again for all of your help help and advise. Appreciate it !