-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Add AsyncPageable scope validation #17635
Add AsyncPageable scope validation #17635
Conversation
@@ -705,7 +705,7 @@ private Request CreateGetRequest(string key, string label, DateTimeOffset accept | |||
/// <param name="cancellationToken">A <see cref="CancellationToken"/> controlling the request lifetime.</param> | |||
private async Task<Page<ConfigurationSetting>> GetConfigurationSettingsPageAsync(SettingSelector selector, string pageLink, CancellationToken cancellationToken = default) | |||
{ | |||
using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(ConfigurationClient)}.{nameof(GetConfigurationSettingsPage)}"); | |||
using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(ConfigurationClient)}.{nameof(GetConfigurationSettings)}"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will these changes be a problem for existing customers given that this is a GA library?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm reluctant to treat this as a breaking change. The scenarios where this would break anyone are pretty theoretical.
…able-scope-validation # Conflicts: # eng/Packages.Data.props
Hello @pakrym! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
bool strict = !invocation.Method.GetCustomAttributes(true).Any(a => a.GetType().FullName == "Azure.Core.ForwardsClientCallsAttribute"); | ||
if (invocation.Method.ReturnType.Name.Contains("Pageable") || | ||
invocation.Method.ReturnType.Name.Contains("IAsyncEnumerable")) | ||
if (invocation.Method.ReturnType is {IsGenericType: true} genericType && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why don't we add the validator for Pageable in addition to AsyncPageable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This validator runs before we forward calls from async->sync so everything would look sync to it.
Fixes: #17633