What package version of the SDK are you using.
241536bbf08d198c94ad4cd52955b4b8c0b89719
Give a clear and concise description of what the bug is.
See my branch https://github.com/xieofxie/botbuilder-dotnet/commit/b4465384ac113f66e67b315dfc2de95a8dc9b57b

It seems when going back to LgBug dialog, the lg generator is still dialog2
Also TestBot.Json can't run due to no range.Path
Steps to reproduce the behavior:
Give a clear and concise description of what you expected to happen.
If applicable, add screenshots to help explain your problem.
Add any other context about the problem here.
[bug]
Thanks @xieofxie can you share more about how you trigger this bug, how your LgBug.main and LgBug() is set? especially the generator field of your dialog.
And can you also create a seperate issue for TestBot.Json can't run without range.Path?
OK, added steps
@Danieladu can you help take a look at this one?
I did some investigation and found that this issue only happens when we added an "EndDialog" action in the sub-dialog. When call EndDialog, the dc is not correctly set.
After more investigation, this appears to be DialogContext is not poped correctly after leaving children, the context is still pointing to children.
Unassign hongyang, and put Tom and Vishwac on.
@tomlm @vishwacsena i just label it P0 from my personal judgement, please triage again.
I also made some investigation on this issue, found that when continuing the action, AdaptiveDialog would push the ScopedServices(language generator) into turn context, and at the end of ContinueActions, it would pop it up. But for some reasons, the SendActivity action does not trigger the ContinueActionsAsync method, so, the current generator of turnContext is still the generator of the subdialog.
@Danieladu @boydc2014 I cannot repro this issue with the latest from master.
Code based adaptive is here
Declarative adaptive is here.
I do see a different error No generator found for language en-us after the end-dialog. Is that the manifestation of the issue? can you confirm that this is declarative only? Might help root cause the issue.
@Danieladu @boydc2014 I cannot repro this issue with the latest from master.
Code based adaptive is here
Declarative adaptive is here.I do see a different error
No generator found for language en-usafter the end-dialog. Is that the manifestation of the issue? can you confirm that this is declarative only? Might help root cause the issue.
Have you tried the user's branch: https://github.com/xieofxie/botbuilder-dotnet/tree/hualxie/lg_bug which can repro in me, Hongyang, and Lu's side.
Hongyang did some inverstigation that, the DialogContext is not correctly poped up a certain setup of the actions, @Danieladu can you detail on this, what's the condition (other than just EndOfDialog) to trigger this bug?
Have you tried the user's branch: https://github.com/xieofxie/botbuilder-dotnet/tree/hualxie/lg_bug which can repro in me, Hongyang, and Lu's side.
Hongyang did some inverstigation that, the DialogContext is not correctly poped up a certain setup of the actions, @Danieladu can you detail on this, what's the condition (other than just EndOfDialog) to trigger this bug?
@vishwacsena
I have checked in the MVP re-pro of this issue on issue3767 branch, link is here: https://github.com/microsoft/botbuilder-dotnet/tree/issue3767
Same re-pro step as hualiang's branch
Hmm.. I will just write some observation here:
In this setup, the dialog stack is main dialog <- begin dialog <- sub dialog <- end dialog
In end dialog, it will end its parent dialog i.e. sub dialog and it will continue in begin dialog.
However, it will only pop lg in the end of continue of sub dialog.
So in the action after begin dialog, it will use lg from sub dialog.
One possible fix is end dialog will end itself and set a special flag. Then in sub dialog when it continues, it will end itself. However, then adaptive dialog mustn't be ended via end dialog function as it will not pop lg
Another thought is popping lg in end dialog function.
Although it will be popped again in the end of continue, but it will only go back to continue function when the turn is ended and the continue will break any way. So pop again is no effect I guess?
this is a real bug. Working on fix
Most helpful comment
this is a real bug. Working on fix