-
Notifications
You must be signed in to change notification settings - Fork 288
Description
Versions
master branch
Describe the bug
If you cancel a waterfall during a named step (a step not defined by an anonymous function), the telemetry logger will treat it as an unnamed step. I noticed that by reading the code. The bug is not in the other repos though it may have originated by copying code from Python and not adapting it correctly. See this line:
var index = instance.state[state.stepIndex];
state
is a local variable that has been assigned the value of instance.state
, so instance.state
and state
are the same thing. It contains a WaterfallDialogState
object and not an array, and state.stepIndex
is a number, so instance.state[state.stepIndex]
will be undefined. The actual step index value can be accessed just with state.stepIndex
. In other languages string constants with names like StepIndex
are used to access properties of the state object, so I believe that's where the confusion is.
To Reproduce
Steps to reproduce the behavior:
- Create a waterfall with a telemetry logger and named steps (not defined by anonymous functions)
- Cancel the waterfall on a named step
- Observe that the telemetry does not contain the name of the step that the waterfall was cancelled on
Expected behavior
Waterfall cancellation telemetry should include the name of the step that the waterfall that it was cancelled on if that name is available.
Additional context
Fixed in this PR but then rolled back due to scoping: #1578
[bug]