Sometimes the whole conversation gets into a loop and there is no way to come out of it. I have tried typing "/deleteprofile", /deleteprofile, etc. It has not worked.
If some kind of reset option is available in Bot framework, it would be nice. Or is there any other way to reset externally that I am not aware of?
At present, i have to delete the bot and add another to come out this loop.
use this code to delete the bot state and user data.
activity.GetStateClient().BotState.DeleteStateForUser(activity.ChannelId, activity.From.Id);
this will delete all the conversation
Thank you for your response. Sorry, I was not clear before. I am using node.js. But the problem is that in some conditions, the botframework keeps communicating with facebook and the bot's session reset programming call does not have any impact on this issue.
@maheshcv I ran into this issue last week. I finally figured out the fix. The issue is related to dialog flows being stored in the session (which is why it persists even if you restart the application). If you are in a subdialog and don't end the dialog properly, you can get trapped into an infinite loop where it tries to complete the dialog with every request. For some reason deleting your profile session data will not work, but as soon as I added the endDialog call to the appropriate logic branch that didn't have it, it took one step to finish up the dialog and then you could clear your session from there and be good to go.
Thanks Ray. I will try it out
On Nov 8, 2016 21:45, "Ray Benefield" [email protected] wrote:
@maheshcv https://github.com/maheshcv I ran into this issue last week.
I finally figured out the fix. The issue is related to dialog flows being
stored in the session (which is why it persists even if you restart the
application. If you are in a subdialog and don't end the dialog properly,
you can get trapped into an infinite loop where it tries to complete the
dialog with every request. For some reason deleting your profile session
data will not work, but as soon as I added the endDialog call to the
appropriate logic branch that didn't have it, it took one step to finish up
the dialog and then you could clear your session from there and be good to
go.—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/Microsoft/BotBuilder/issues/1520#issuecomment-259181417,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ACxGiF-L6txa63xDdL9O-pfVsa3btCBPks5q8KA8gaJpZM4KhAai
.
Sorry i got no idea with Node.js
May be there will be a equivalent function in node for the same.
Sorry for the delay... There are a couple of options. You can use the dialogVersion() middleware to add a reset command to your bot or simply increment the major version number to clear all users dialog stacks automatically:
// Anytime the major version is incremented any existing conversations will be restarted.
bot.use(builder.Middleware.dialogVersion({ version: 1.0, resetCommand: /^reset/i }));
The other option is to add a global endConversationAction() that lets a user say goodbye to clear things up:
bot.endConversationAction('goodbye', 'Goodbye :)', { matches: /^goodbye/i });
@Stevenic Equivalent c# code?
Adding WIll & Shahin
None of the examples from @Stevenic above actually delete what's in session.userData, not in the simulator nor in Facebook. Only the conversation is restarted back to / from what I can see, Is this the expected behavior?
@alokraj68 in C#, DeleteProfileScorable implements the logic. You can change the command that triggers the scorable by injecting your custom regular expression in the conversation container. Here is were the default regular expression is registered: https://github.com/Microsoft/BotBuilder/blob/master/CSharp/Library/Dialogs/DialogModule.cs#L210
A default delete profile scorable based on the bot version is in our backlog.
@Stevenic or @maxpert can you answer the node question?
There's not anyway in Node to delete userData currently without just emptying it. I can think about improving this in 3.6
@msft-shahins DeleteProfileScorable link seems to be 404, can you fix or comment on that please?
@Unders0n
DeleteProfileScorable can be found here: https://github.com/Microsoft/BotBuilder/blob/master/CSharp/Library/Microsoft.Bot.Builder/Dialogs/DeleteProfileScorable.cs
@EricDahlvang thanks, and seems like this link https://github.com/Microsoft/BotBuilder/blob/master/CSharp/Library/Dialogs/DialogModule.cs#L210 was providing some info on how to use it? (its also 404)
@Unders0n That can be found here: https://github.com/Microsoft/BotBuilder/blob/master/CSharp/Library/Microsoft.Bot.Builder.Autofac/Dialogs/DialogModule.cs
bot.use(builder.Middleware.dialogVersion({ version: 1.0, resetCommand: /^reset/i }));
the version is referred to Bot version?
@cheahengsoon This is referring to the dialogVersion. https://github.com/microsoft/BotBuilder-V3/blob/master/Node/core/lib/middleware/Middleware.js#L10 (Since dialogs are stored in the state store, if the developer makes changes to the dialog's code that would affect the ability to retrieve it from storage, the SDK provides an option to version the dialog and automatically clear previous state based on version changes.)
@cheahengsoon This is referring to the dialogVersion. https://github.com/microsoft/BotBuilder-V3/blob/master/Node/core/lib/middleware/Middleware.js#L10 (Since dialogs are stored in the state store, if the developer makes changes to the dialog's code that would affect the ability to retrieve it from storage, the SDK provides an option to version the dialog and automatically clear previous state based on version changes.)
I had check the version , the version is 3, but its still display" Sorry. The service was upgraded and we need to start over."
@cheahengsoon I would need to see the code, to try and help determine what is going wrong. Please open a new issue here: https://github.com/microsoft/BotBuilder-V3/ with details and a minimal code example demonstrating the issue.
Most helpful comment
use this code to delete the bot state and user data.
activity.GetStateClient().BotState.DeleteStateForUser(activity.ChannelId, activity.From.Id);this will delete all the conversation