diff --git a/libraries/Microsoft.Bot.Builder.Dialogs.Adaptive/Actions/LogAction.cs b/libraries/Microsoft.Bot.Builder.Dialogs.Adaptive/Actions/LogAction.cs index 8f15249c62..fbd0a8c662 100644 --- a/libraries/Microsoft.Bot.Builder.Dialogs.Adaptive/Actions/LogAction.cs +++ b/libraries/Microsoft.Bot.Builder.Dialogs.Adaptive/Actions/LogAction.cs @@ -80,7 +80,7 @@ public LogAction(string text = null, [CallerFilePath] string callerPath = "", [C return await dc.EndDialogAsync(cancellationToken: cancellationToken).ConfigureAwait(false); } - var text = await Text.BindAsync(dc, dc.State).ConfigureAwait(false); + var text = await Text.BindAsync(dc, dc.State, cancellationToken: cancellationToken).ConfigureAwait(false); var properties = new Dictionary() { diff --git a/libraries/Microsoft.Bot.Builder.Dialogs.Adaptive/Actions/UpdateActivity.cs b/libraries/Microsoft.Bot.Builder.Dialogs.Adaptive/Actions/UpdateActivity.cs index 0c5dd8e0bf..c39bf26221 100644 --- a/libraries/Microsoft.Bot.Builder.Dialogs.Adaptive/Actions/UpdateActivity.cs +++ b/libraries/Microsoft.Bot.Builder.Dialogs.Adaptive/Actions/UpdateActivity.cs @@ -74,7 +74,7 @@ public UpdateActivity(string text = null, [CallerFilePath] string callerPath = " return await dc.EndDialogAsync(cancellationToken: cancellationToken).ConfigureAwait(false); } - var activity = await Activity.BindAsync(dc, dc.State).ConfigureAwait(false); + var activity = await Activity.BindAsync(dc, dc.State, cancellationToken: cancellationToken).ConfigureAwait(false); var properties = new Dictionary() { diff --git a/libraries/Microsoft.Bot.Builder.Dialogs.Adaptive/Input/OAuthInput.cs b/libraries/Microsoft.Bot.Builder.Dialogs.Adaptive/Input/OAuthInput.cs index 496a94de6b..1166125558 100644 --- a/libraries/Microsoft.Bot.Builder.Dialogs.Adaptive/Input/OAuthInput.cs +++ b/libraries/Microsoft.Bot.Builder.Dialogs.Adaptive/Input/OAuthInput.cs @@ -227,7 +227,7 @@ public class OAuthInput : InputDialog // increase the turnCount as last step dc.State.SetValue(TURN_COUNT_PROPERTY, turnCount + 1); var prompt = await this.OnRenderPromptAsync(dc, inputState, cancellationToken).ConfigureAwait(false); - await dc.Context.SendActivityAsync(prompt).ConfigureAwait(false); + await dc.Context.SendActivityAsync(prompt, cancellationToken).ConfigureAwait(false); await SendOAuthCardAsync(dc, promptOptions?.Prompt, cancellationToken).ConfigureAwait(false); return Dialog.EndOfTurn; } diff --git a/libraries/Microsoft.Bot.Builder.Dialogs/DialogContainer.cs b/libraries/Microsoft.Bot.Builder.Dialogs/DialogContainer.cs index e42c545826..93802c8958 100644 --- a/libraries/Microsoft.Bot.Builder.Dialogs/DialogContainer.cs +++ b/libraries/Microsoft.Bot.Builder.Dialogs/DialogContainer.cs @@ -47,6 +47,7 @@ protected virtual string GetInternalVersion() /// CheckForVersionChangeAsync. /// /// dialog context. + /// cancellationToken. /// task. /// /// Checks to see if a containers child dialogs have changed since the current dialog instance @@ -54,24 +55,7 @@ protected virtual string GetInternalVersion() /// /// This should be called at the start of `beginDialog()`, `continueDialog()`, and `resumeDialog()`. /// - protected virtual Task CheckForVersionChangeAsync(DialogContext dc) - { - return CheckForVersionChangeAsync(dc, default(CancellationToken)); - } - - /// - /// CheckForVersionChangeAsync. - /// - /// dialog context. - /// cancellationToken. - /// task. - /// - /// Checks to see if a containers child dialogs have changed since the current dialog instance - /// was started. - /// - /// This should be called at the start of `beginDialog()`, `continueDialog()`, and `resumeDialog()`. - /// - protected virtual async Task CheckForVersionChangeAsync(DialogContext dc, CancellationToken cancellationToken) + protected virtual async Task CheckForVersionChangeAsync(DialogContext dc, CancellationToken cancellationToken = default(CancellationToken)) { var current = dc.ActiveDialog.Version; dc.ActiveDialog.Version = this.GetInternalVersion(); @@ -82,7 +66,7 @@ protected virtual async Task CheckForVersionChangeAsync(DialogContext dc, Cancel // Give bot an opportunity to handle the change. // - If bot handles it the changeHash will have been updated as to avoid triggering the // change again. - var handled = await dc.EmitEventAsync(DialogEvents.VersionChanged, this.Id, true, false).ConfigureAwait(false); + var handled = await dc.EmitEventAsync(DialogEvents.VersionChanged, this.Id, true, false, cancellationToken).ConfigureAwait(false); if (!handled) { // Throw an error for bot to catch diff --git a/tests/Microsoft.Bot.Builder.TestBot.Json/Samples/CycleDetection/Child1.dialog b/tests/Microsoft.Bot.Builder.TestBot.Json/Samples/CycleDetection/Child1.dialog index e6bf7887c9..a0d1de6c23 100644 --- a/tests/Microsoft.Bot.Builder.TestBot.Json/Samples/CycleDetection/Child1.dialog +++ b/tests/Microsoft.Bot.Builder.TestBot.Json/Samples/CycleDetection/Child1.dialog @@ -1,21 +1,22 @@ { + "$schema": "../../testbot.schema", "$kind": "Microsoft.AdaptiveDialog", "triggers": [ { "$kind": "Microsoft.OnBeginDialog", - "actions": [ - { - "$kind": "Microsoft.SendActivity", - "activity": "World" - }, - { - "$kind": "Microsoft.EndTurn" - }, - { - "$kind": "Microsoft.BeginDialog", - "dialog": "Root.dialog" - } - ] + "actions": [ + { + "$kind": "Microsoft.SendActivity", + "activity": "World" + }, + { + "$kind": "Microsoft.EndTurn" + }, + { + "$kind": "Microsoft.BeginDialog", + "dialog": "Root.dialog" + } + ] } ] } \ No newline at end of file diff --git a/tests/Microsoft.Bot.Builder.TestBot.Json/Samples/CycleDetection/Root.dialog b/tests/Microsoft.Bot.Builder.TestBot.Json/Samples/CycleDetection/Root.dialog index 532f56a78b..d070f704a2 100644 --- a/tests/Microsoft.Bot.Builder.TestBot.Json/Samples/CycleDetection/Root.dialog +++ b/tests/Microsoft.Bot.Builder.TestBot.Json/Samples/CycleDetection/Root.dialog @@ -1,4 +1,5 @@ { + "$schema": "../../testbot.schema", "$kind": "Microsoft.AdaptiveDialog", "triggers": [ {