Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,11 @@ public CancelAllDialogs([CallerFilePath] string callerPath = "", [CallerLineNumb

if (dc.Parent == null)
{
return await dc.CancelAllDialogsAsync(true, EventName.GetValue(dcState), this.EventValue.GetValue(dcState), cancellationToken).ConfigureAwait(false);
return await dc.CancelAllDialogsAsync(true, EventName?.GetValue(dcState), this.EventValue?.GetValue(dcState), cancellationToken).ConfigureAwait(false);
}
else
{
var turnResult = await dc.Parent.CancelAllDialogsAsync(true, EventName.GetValue(dcState), this.EventValue.GetValue(dcState), cancellationToken).ConfigureAwait(false);
var turnResult = await dc.Parent.CancelAllDialogsAsync(true, EventName?.GetValue(dcState), this.EventValue?.GetValue(dcState), cancellationToken).ConfigureAwait(false);
turnResult.ParentEnded = true;
return turnResult;
}
Expand Down
2 changes: 1 addition & 1 deletion libraries/Microsoft.Bot.Builder.Dialogs/Recognizer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public class Recognizer
/// <param name="telemetryProperties">Additional properties to be logged to telemetry with the LuisResult event.</param>
/// <param name="telemetryMetrics">Additional metrics to be logged to telemetry with the LuisResult event.</param>
/// <returns>Analysis of utterance.</returns>
public virtual async Task<RecognizerResult> RecognizeAsync(DialogContext dialogContext, Activity activity, CancellationToken cancellationToken = default, Dictionary<string, string> telemetryProperties = null, Dictionary<string, double> telemetryMetrics = null)
public virtual Task<RecognizerResult> RecognizeAsync(DialogContext dialogContext, Activity activity, CancellationToken cancellationToken = default, Dictionary<string, string> telemetryProperties = null, Dictionary<string, double> telemetryMetrics = null)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand this, and it seems like an odd one. Can you elaborate?

{
throw new NotImplementedException();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ public async Task Action_BeginDialogWithoutActivity()
await TestUtils.RunTestScript(ResourceExplorer);
}

[TestMethod]
public async Task Action_CancelAllDialogs()
{
await TestUtils.RunTestScript(ResourceExplorer);
}

[TestMethod]
public async Task Action_ChoiceInput()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
{
"$schema": "../../../../schemas/sdk.schema",
"$kind": "Microsoft.Test.Script",
"dialog": {
"$schema": "../../app.schema",
"$kind": "Microsoft.AdaptiveDialog",
"recognizer": {
"$kind": "Microsoft.RegexRecognizer",
"intents": [
{
"intent": "CancelIntent",
"pattern": "(?i)cancel|never mind"
}
]
},
"triggers": [
{
"$kind": "Microsoft.OnBeginDialog",
"actions": [
{
"$schema": "../../app.schema",
"$kind": "Microsoft.AdaptiveDialog",
"recognizer": {
"$kind": "Microsoft.RegexRecognizer",
"intents": [
{
"intent": "CancelIntent",
"pattern": "(?i)cancel|never mind"
}
]
},
"triggers": [
{
"$kind": "Microsoft.OnBeginDialog",
"actions": [
{
"$kind": "Microsoft.SendActivity",
"activity": "Why did the chicken cross the road?"
},
{
"$kind": "Microsoft.EndTurn"
},
{
"$kind": "Microsoft.SendActivity",
"activity": "To get to the other side"
}
]
},
{
"$kind": "Microsoft.OnIntent",
"intent": "CancelIntent",
"actions": [
{
"$kind": "Microsoft.SendActivity",
"activity": "Canceled"
},
{
"$kind": "Microsoft.CancelAllDialogs"
}
]
}
]
},
{
"$kind": "Microsoft.SendActivity",
"activity": "What am I doing here?"
}
]
}
]
},
"script": [
{
"$kind": "Microsoft.Test.UserSays",
"text": "hi"
},
{
"$kind": "Microsoft.Test.AssertReply",
"text": "Why did the chicken cross the road?"
},
{
"$kind": "Microsoft.Test.UserSays",
"text": "cancel"
},
{
"$kind": "Microsoft.Test.AssertReply",
"text": "Canceled"
},
{
"$kind": "Microsoft.Test.UserSays",
"text": "hi"
},
{
"$kind": "Microsoft.Test.AssertReply",
"text": "Why did the chicken cross the road?"
}
]
}