Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Style: Async method nomenclature, missing ConfigureAwait and CancellationTokens #3892

Merged
merged 2 commits into from
May 8, 2020

Conversation

carlosscastro
Copy link
Member

Fixes #3889

@@ -388,7 +388,7 @@ public async Task<JToken> ResolveRefAsync(JToken refToken, SourceContext sourceC
}
}

var (json, range) = await ReadTokenRangeAsync(resource, sourceContext);
var (json, range) = await ReadTokenRangeAsync(resource, sourceContext).ConfigureAwait(false);
Copy link
Member

@johnataylor johnataylor May 8, 2020

Choose a reason for hiding this comment

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

cancellation token
#Resolved

@@ -53,7 +54,24 @@ protected virtual string GetInternalVersion()
///
/// This should be called at the start of `beginDialog()`, `continueDialog()`, and `resumeDialog()`.
/// </remarks>
protected virtual async Task CheckForVersionChangeAsync(DialogContext dc)
protected virtual Task CheckForVersionChangeAsync(DialogContext dc)
Copy link
Member

Choose a reason for hiding this comment

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

this is a bit weird - why not plumb through the cancellation

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree


In reply to: 422350766 [](ancestors = 422350766)

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh because it is in the dialogs assembly and it is abreaking change to binary level backward compat

Copy link
Contributor

Choose a reason for hiding this comment

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

no this is new method, we should fix.


In reply to: 422385918 [](ancestors = 422385918)

@carlosscastro
Copy link
Member Author

Thanks @johnataylor ! Code analisys detects ConfigureAwait and async names but not cancellation tokens so it's more manual. Appreciate the detailed review, new iteration incoming

@carlosscastro carlosscastro merged commit ef9bb54 into 4.9 May 8, 2020
@carlosscastro carlosscastro deleted the ccastro/adaptive-style branch May 8, 2020 20:51
@tomlm
Copy link
Contributor

tomlm commented May 8, 2020

    public async Task<T> LoadTypeAsync<T>(Resource resource)

no cancelation token?


Refers to: libraries/Microsoft.Bot.Builder.Dialogs.Declarative/Resources/ResourceExplorer.cs:155 in 3daaf46. [](commit_id = 3daaf46, deletion_comment = False)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants