-
Notifications
You must be signed in to change notification settings - Fork 528
Inconsistent bot response in Teams channel #2722
Comments
@Virtual-Josh at the very least we're probably going to need to make sure customer understand how to use Sidecar debugging in the Emulator so they can test against the teams environment. |
Hi @SreekanthOAuth, There's a couple of things to know. First, you can use the Bot Framework Emulator to debug your bot within Teams. In the Emulator you can go to "Help"-> "Get started with channels (Bot Inspector)" to see the instructions for how to set it up. Second, the Emulator will work as documented within a one-to-one and group chat. If you are having issues with that then let us know. Third, there's a bug in messages in a team. When you do the microsoft/botbuilder-dotnet#2955 Let me know if you have any other questions. |
Hi @Virtual-Josh, we don't see any issue in Emulator. Here Bot is working as expected. Thanks, |
I need you to give me a full overview of what you're doing in order to figure out what's wrong. Here are some initial questions I'm particularly interested in.
Alternatively you can view a sample we have for Teams (C# JS) if you want to try to self-service. |
Teams Bots will receive a conversationupdate event when the user first adds the bot for 1:1 chat, or the bot is added to a team. Not when new conversations are created in the team or a team member messages the bot. If the welcome message is sent from ConversationUpdate's OnMemberAdded: it will not fire in Teams at the same times as it does in the emulator. WebChat and the Emulator send a conversation update when they connect (since they both create new conversations during startup). You could track who has messaged the bot, and respond with a welcome message on first contact. This mechanism isn't built into the sdk, so it is something custom that would need to be coded in your bot. |
@EricDahlvang - Sorry for the late reply. Ok. Let me give some more details about it. We have Virtual Assistant and custom skills. When a user request for something, the flow goes from Virtual Assistant to respective skill. Inside skill, there is dc.endDialog() method in complete(). This function is getting executing as expected in Emulator, Webchat and SMS channels. But based on our analysis, this seems not working as expected in teams. The context is not being cleared out. So that we see the same skill menu which we have requested first time on every time (even you requested different intent) Created custom skill (of type Typescript), based below documentation, And one more thing is,
Please suggest on this. Thanks, |
I see this issue which discuss similar issue and it workaround in C#bot however we need workaround for typescript bot. |
Hey @gabog since we are now talking about skills can you take a look at this ticket to help resolve? |
Hey @SreekanthOAuth, I'm going to move this issue over to the botframework-solutions repo since the core problem is the VA/Skills routing. |
@SreekanthOAuth - We have updated our VA template and libs to support intro message and auth in Teams. Please try updating your project and let us know if the issues are resolved. |
@lauren-mills - Thanks for the update. We have been working on Virtual Assistant since from 5 months. So we have a lot of updates to our VA. We are on Typescript Thanks, |
The updates have been made to the C# template, and should be coming to the typescript template soon. The primary changes were to inherit from the TeamsActivityHandler instead of IBot in the DialogBot class. Here is the file in the C# template, and I believe the TypeScript changes should be the same, but let me know if you run into any issues. https://github.com/microsoft/botframework-solutions/blob/master/templates/Virtual-Assistant-Template/csharp/Sample/VirtualAssistantSample/Bots/DefaultActivityHandler.cs |
Thanks for the update. We will try and get back to you. Thanks, |
We see the DialogBot is extending from ActivityHandler in current virtual assistant. We don't find 'TeamsActivityHandler' in 'botbuilder' npm package. And, below are few more queries Please let me know if you need any further details on it. Thanks, |
I can see the teamsActivityHandler in the source for botbuilder-js here. Can you make sure you're on version 4.6? This change should be made in any bot that will be directly accessed via teams. If you plan on exposing your skill directly (rather than through a VA) you would also need this change to enable Teams activity handling. Otherwise, it is not critical to update the skill project. Also, despite the name, this activity handler will work for all the other channels in addition to Teams. It just adds additional Teams handling. |
After installing the latest version, seeing exceptions while starting the server. Could you please suggest us on this. |
@Batta32 - can you take a look at the error log above and give any advice? |
Hi @SreekanthOAuth, we came up with some questions related to the installation you made.
The issue might be related to a disparity of
We will be attentive to your answer 😊. |
@Batta32 , Thanks for details. Today, we have tried these and not seeing errors while starting the server. But we are seeing an issue when we request the utterance in teams channel, And getting staus code as 501 which means NOT_IMPLEMENTED
Based on these logs and our analysis, seems the Activity Type is going as Invoke and inside below code, it's getting failed.
Could you please suggest us on this. Thanks, |
Hi @SreekanthOAuth, we came up with some questions to figure out what's wrong.
|
Hi @Batta32 , please find the answers below 1.Can you share the entire log file with the errors if it's available? 2.Can you verify if this issue happens using the Emulator? |
Hi @SreekanthOAuth, sorry for the delay. We managed to reproduce your scenario which we solved overriding the method With this said, could you tell us if you are implementing the method public async handleTeamsSigninVerifyState(context: TurnContext, state: SigninStateVerificationQuery): Promise<void> {
await this.dialog.run(context, this.state);
} To accomplish this, we followed these steps using the Virtual Assistant Sample:
The overridden Additional Context
We hope this helps you 😊. |
Hi @Batta32 , thanks for the update. I have tried to adding these changes but getting some errors After adding changes, dialogBot.ts file ` import { export class DialogBot extends TeamsActivityHandler {
} ` Here w.r.t dialog and dialogState create new attributes. Could you please suggest. Thanks, |
Hi @SreekanthOAuth! If you are not able to use the run method, you should add a type for
You can check those changes in our pushed branch with a modified Virtual Assistant Sample that implements the Teams Sign In. Finally, you can take a look at the NodeJS Sample 46 for how it implements the run method with waterfall dialog. Let us know if this helps or you have any other issue 😊. |
Closing due to inactivity. Please reopen as needed. |
@lauren-mills , could you please reopen the issue as the issue still exists. We have tried your suggestions based on recent comments. However, we are still encountering with the problem. The real issue over here is,
Please do let us know if you need any additional information. Thanks, |
Hi @SreekanthOAuth! We are looking into this. |
Hi @SreekanthOAuth, We were able to reproduce your issue using the master branch, but also made the same test on next and it worked without issues. These are the steps we followed to reproduce the issue:
We also did the same test using the next branch, and the issue was not found Note: To use the This means that this issue will be fixed in the soon to be released version of TypeScript library. |
Sorry for the late reply. I'll check and give an update. |
Hi @SreekanthOAuth, Please test again with the newly implemented changes. |
Please re-open if you run into the issue again |
Please re-open this. We tried to fixed based on the suggestion "replacing" ActivityType.EndOfConversation to ActivityType.HandOff and implementing TeamActivityHander. However, the fundamental issue is EndOfConversation ActivityType is not supported by MSTeam. We are really stuck and can not promise our internal stakeholders for MSTeam bot availability. |
Need your assistance on this.
Please let me know if you need more details on this.
Thanks,
Sreekanth
The text was updated successfully, but these errors were encountered: