microsoft / botbuilder-dotnet

Welcome to the Bot Framework SDK for .NET repository, which is the home for the libraries and packages that enable developers to build sophisticated bot applications using .NET.
https://github.com/Microsoft/botframework
MIT License
864 stars 480 forks source link

Issue with Multiple Messages in Slack Bot Channel after Updating to Microsoft Bot Builder SDK Version 4.22.0 #6746

Closed NeethithevanR closed 3 months ago

NeethithevanR commented 5 months ago

I updated to the latest Microsoft Bot Builder SDK version 4.22.0. When I trigger an action from the Slack bot channel, I am receiving multiple messages. Additionally, I am using the Slack adapter (Bot.Builder.Community.Adapters.Slack) version 4.13.5.

tracyboehrer commented 5 months ago

@ceciliaavila and team, off the top of my head I can't think of anything in 4.22.0 that would impact this. While we don't support the Slack Adapter, it's worth verifying something didn't change.

cult-security-mikko commented 5 months ago

We have observed the same issue. Our internal testing showed that when updating from 4.19.3 to 4.20.0 we start to see the multiple messages issue.

We use the community Slack adapter with a Bot Framework Composer based bot.

NeethithevanR commented 5 months ago

@cult-security-mikko, We are encountering a different issue with the Slack adapter version 4.13.5 (Bot.Builder.Community) combined with Microsoft Bot Builder version 4.13. Regarding the issue: Sometimes, the bot state is not saved properly, resulting in incorrect conversation history. This inconsistency leads to inconsistent bot responses. As a solution, we considered upgrading to a newer version. However, we are facing the aforementioned issue. Is it acceptable to use the "Bot.Builder.Community" adapters? Alternatively, do you have any suggestions? Additionally, if possible, could you share your setup details (at a higher level) in the bot?

tracyboehrer commented 5 months ago

@cult-security-mikko The version in SDK is deprecated, and the only recommended version is on Community. However, we don't directly support that repo. If you know of the fix, you can submit a PR on that repo.

cult-security-mikko commented 5 months ago

@tracyboehrer Might have been a bit unclear from my previous comment. We are using the latest community version of the adapter, not the one included in the BF SDK. We need quite specific multi environment support on Slack so needed to originally move to the community one because of that requirement.

Our situation is such that we are using the 4.19.3 version of BF SDK still, as that version does not exhibit the multi message behaviour when used with the latest version of community repo Slack adapter. If we update using this setup from 4.19.3 -> 4.20.0 we start seeing the multi message behaviour with Slack. This does not happen with Teams or webchat/directline channels.

@NeethithevanR As we are on a newer BF SDK I think this might be why we haven's seen all the same issues as in your situation. What do see with our Composer/Adaptive runtime based bot is if we deploy a new version of the bot and a user is in the middle of a conversation where the content has been changed there are some issues with continuing the conversation. Of course this is quite understandable as the underlying conversation structure has changed. One solution to this is to reset the user/conversation state. This of course means that the user will need to restart what ever they are doing. This is quite a rare occurrence for us so not high enough on the task list to solve for now.

What comes to your question about acceptable I cannot really comment on that. If the community adapter for Slack works for you then it might be the way forward. As @tracyboehrer pointed out the version in BF SDK is not supported anymore. We have been able to utilize the latest Slack adapter version from the community repo with BF SDK 4.19.3 with decent results.

tracyboehrer commented 5 months ago

I am mostly sure we've never tested any of the Community adapters with a Composer-based bot. Those adapters would have been designed and written pre-Composer, or at least with a non-Composer bot in mind. 4.20.0 was a larger release, so we can definitely research why that could be causing an issue.

cult-security-mikko commented 5 months ago

That would we excellent if it is not too much trouble. A possible solution or a timeline would help a lot as we would like to be able to update to the latest BF SDK version. Never know when vulnerabilities pop up etc.

JhontSouth commented 4 months ago

Hi @NeethithevanR, @cult-security-mikko We prepared our environment to use a Slack bot, but we haven't been able to reproduce the error. @NeethithevanR, Could you please give us more details of the actions that are triggering the error? Are you also using a Composer bot? @cult-security-mikko, Do you have more information about how to configure a Composer bot using Bot.Builder.Community.Adapters.Slack? Which settings are needed? Thanks

NeethithevanR commented 4 months ago

@JhontSouth, I'm using Bot Builder Composer (version 2.1.2) to build my chat application, and the .NET versions (netcoreapp3.1/net6.0). I'm using Microsoft.Bot.Builder (version 4.22.0). In my chatbot, I have a trigger called "help" that displays the main menu. In the previous version (4.19.3), it worked fine. However, after upgrading to the latest version, the main menu appears multiple times.

Please find the attachment below.

Screenshot 2024-02-16 at 8 11 33 PM