Closed cplanson closed 2 years ago
This is likely due to the fact that slack will resend messages if you do not respond within a small amount of time.
In order to resolve this, you'll want to return a promise from your handler, and handle the dialog inside the promise. This will allow it to respond to slack quickly.
This requires you to call await bot.changeContext(message.reference) inside the promise.
Hi,
Are you sure this is an issue with the Botkit core module?
Yes
What are you trying to achieve or the steps to reproduce?
We're trying to create a simple conversation using
BotkitConversation
. The conversation includes a confirmation question. If the user confirms it triggers a somewhat "long running" operation (more than 3 seconds). But then botkit triggers the handler twice. I reproduced the error using a simplesetTimeout
, and the threshold to reproduce the issue seems to be around 3 seconds :What was the result you received?
When answering 'yes' the corresponding handler is triggered twice, the conversation seems to have been duplicated, all following bot answers are sent twice to slack.
What did you expect?
The handler is triggered only once.
Context: