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

Fix async wrapper over sync API in reading nested property info #2995

Conversation

gathogojr
Copy link
Contributor

@gathogojr gathogojr commented Jun 7, 2024

Description

Fix async wrapper over sync API in reading nested property info - prevent inadvertent sync IO

This is why/how the sync method was being called:

protected virtual Task<bool> ReadAtNestedPropertyInfoImplementationAsync()
{
return TaskUtils.GetTaskForSynchronousOperation<bool>(this.ReadAtNestedPropertyInfoImplementation);
}

The async methods are declared in the ODataReaderCoreAsync base class and their default implementation is to wrap the sync method.

If they're not overridden in the derived class, they'll do sync IO. The ReadAtNestedPropertyInfoImplementationAsync was inadvertently not overridden in ODataJsonLightReader class.

Checklist (Uncheck if it is not completed)

  • Test cases added
  • Build and test with one-click build and test script passed

@gathogojr gathogojr merged commit e6ce780 into OData:main Jun 10, 2024
5 checks passed
@gathogojr gathogojr deleted the fix/async-wrapper-over-sync-in-reading-nested-property-info branch June 10, 2024 07:35
gathogojr added a commit to gathogojr/odata.net that referenced this pull request Jun 10, 2024
gathogojr added a commit to gathogojr/odata.net that referenced this pull request Jun 10, 2024
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.

3 participants