botbuilder-community-dotnet: FormFlow State doesn't properly reset on FormCanceledException
This stems from @paul198204’s (@EricDahlvang: this is Praveen) issue where basically:
- User starts FormFlow Dialog
- User says “quit” and bot cancels all dialogs
- User attempts to restart FormFlow Dialog, but instead continues where they left off
Not being familiar with FormFlow, I’m posting this here for additional help.
My guess is that the else clause from here should call _formState.Reset():
catch (Exception inner)
{
if (!(inner is FormCanceledException<T>))
{
throw new FormCanceledException<T>(inner.Message, inner)
{
LastForm = _state,
Last = _form.Steps[_formState.Step].Name,
Completed = (from step in _form.Steps
where _formState.Phase(_form.StepIndex(step)) == StepPhase.Completed
select step.Name).ToArray()
};
}
// HERE
else
{
throw;
}
}
}
I also considered recommending that the user call Reset() manually since it’s public in FormState. However, they’d like to call it from outside of FormDialog but FormDialog has _formState private.
There’s likely a way to do this, but again, I’m not very familiar with FormFlow.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 16 (11 by maintainers)
I am of the opinion we should close this issue until we have other complaints. There are a lot of people using this library as-is, and they do not seem to behaving problems. If we get other complaints, it might become worth the risk of updating.