-
Notifications
You must be signed in to change notification settings - Fork 175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple responses from Slack adapter in Bot framework Composer #533
Comments
Hey! I believe it's something I ran into. This happens because the bot is not acknowledging the request in less than 3 seconds to slack. Check this out: microsoft/botbuilder-dotnet#5405 I had a fix that was never merged but I implemented it in a custom adapter. |
@martinlarosa , Thank you for responding. I tried that fix. But its not working in my case. |
Have you tried just immediately echoing a response in your bot? As previously stated it sounds like your bot just needs to send some sort of response but has gone quiet. IMO extending the timeout isn't a great solution, people have a very low threshold to waiting for some form of response |
@martinlarosa , That fix you have made in https://github.com/microsoft/botbuilder-dotnet. But that repository was no longer active. So,I am using @botbuildercommunity . |
Check the code in the commit of my PR, it's very few lines of code. They never merged it to the other repo anyway. There problem is that Slack needs the HTTP request to be acknowledged by the bot in less than 3 seconds. Otherwise it will start retrying. That's why you see multiple messages. My solution was to not await the RunPipelineAsync call, and change the code so that it would run async. That way the bot can return the ACK to Slack, telling Slack that the message was received, while it's moving on doing it's own thing. |
I use the Bot Builder community Slack adapter in my Bot service (using Bot Framework Composer v 2.1.2). And it is implemented using DOTNET(version 3.1). Currently, the issue I am facing is: when I trigger a message from my Bot channel to my Bot service, I receive multiple responses in my Bot channel. I looked at a few documents and worked around the issue using the "X-Slack-Retry-Num" request header coming along with slack API. But I feel that this is not a proper fix for the issue, as there could be genuine needs for retries later.
The workaround I made:
string slackRetry = Request.Headers["X-Slack-Retry-Num"];
if (string.IsNullOrEmpty(slackRetry)){
await adapter.ProcessAsync(Request, Response, _bot).ConfigureAwait(false);
}
Please let me know if there is a better fix for the issue above, which I believe is something to do with sending acknowledgement back to slack. This is something I am not able to figure out where and how to code. If possible, please refer some appropriate documentation to me.
The text was updated successfully, but these errors were encountered: