botframework-sdk icon indicating copy to clipboard operation
botframework-sdk copied to clipboard

Cancel PromptDialog after certain time NET sdk

Open mosharov opened this issue 7 years ago • 8 comments

Issue from https://github.com/Microsoft/BotBuilder/issues/2102 but looks like no backlog issues in progress now

mosharov avatar Dec 27 '18 08:12 mosharov

So the cleanest way to achieve this is to timeout the bots entire conversation state... No matter what you need to wait for the users next message to determine if it's been more then 20 seconds since you prompted them (although I'd personally give them like 20 - 30 minutes.)

There's no great way for your bot to know where exactly the user is conversationally with the bot so my recommendation is to create a conversation state property called lastMessageTime or something which you check and then set at the begging of every turn with the user. When the turn starts, read this property and if its either missing or less then your timeout value simply set it to be the current time and then route the users message as you normally would. If the time stamp has expired then clear the current conversation state by calling ConversationState.deleteAsync() and then set it to be the current timestamp.

Stevenic avatar Dec 28 '18 23:12 Stevenic

We need to investigate how best to achieve something like this. There is no timeout mechanism currently built into the SDK.

benbrown avatar Jun 10 '19 20:06 benbrown

Moving off Support for engineering to sort out the DCR

CoHealer avatar Jul 02 '19 15:07 CoHealer

One interesting implementation option for timing out a conversation (if using CosmosDb for state):

https://docs.microsoft.com/en-us/azure/cosmos-db/time-to-live

EricDahlvang avatar Jul 02 '19 18:07 EricDahlvang

we have an event model approach to solve this. @Stevenic has a design that builds upon his comment above. we also need to make a call if this is adaptive only or not.

sgellock avatar Jul 02 '19 20:07 sgellock

@Stevenic @tomlm and I discussed this today and we should discuss different scenarios and their ramification before we add native support for this.

For now, the workaround suggested by @Stevenic puts the bot author in control of the timeout logic as well as how it is interpreted/ handled.

@sgellock - recommend that we push this out to R7 so we have a deeper architectural discussion and track a DCR if we decide to support this in the SDK.

vishwacsena avatar Oct 23 '19 01:10 vishwacsena

Moving to R7 for reason's called about above by @vishwacsena

sgellock avatar Oct 23 '19 03:10 sgellock

We're going to resolve this as won't fix. per Steve's comments above

sgellock avatar Nov 26 '19 00:11 sgellock