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

[Internal] Query : Fixes response parsing error for ReadFeed by limiting binary format to query operations #4515

Conversation

adityasa
Copy link
Contributor

@adityasa adityasa commented May 24, 2024

Pull Request Template

Description

This change restricts use of SupportedSerializationFormats header to query scenarios only. Technically, this header is only used by QueryRequestOptions, however, the QueryRequestOptions (and therefore this header) also get invoked for ReadFeed. There is no direct API for ReadFeed, instead any of the query APIs (GetItemLinqQueryable, GetItemQueryIterator, GetItemStreamQueryIterator) invoke ReadFeed operation (instead of Query operation) if supplied query (or QueryDefinition) is null.

ReadFeed API in the backend currently doesn't support this header and returns the response in text. However as it turns out, if this API is invoked with a specific partition key in the request options, backend honors the header. This is an issue, since SDK doesn't support handling of binary response in ReadFeed codepath.

As a result, when query APIs are invoked with query = null and a specific partition key, response cannot be parsed successfully. The issue is recently discovered after new emulator is published, which enabled binary encoding by default (when /EnablePreview flag is supplied). The issue was discovered in the form of test failures in the pipeline (which uses latest emulator with EnablePreview flag).
Currently following tests are failing:
EncryptionCreateItemAndQuery
ValidateSupportedSerializationFormatsRntbd
ValidateSupportedSerializationFormatsGateway

This change fixes following tests:
ValidateSupportedSerializationFormatsRntbd
ValidateSupportedSerializationFormatsGateway

The encryption project does not use the SDK code from master (by referencing project), but rather released SDK v3.35.4. The failing portion of the EncryptionCreateItemAndQuery test is made conditional, by only allowing to run when SDK project is referenced.

Type of change

Please delete options that are not relevant.

  • [] Bug fix (non-breaking change which fixes an issue)
  • [] New feature (non-breaking change which adds functionality)
  • [] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [] This change requires a documentation update

Closing issues

To automatically close an issue: closes #IssueNumber

@adityasa adityasa marked this pull request as ready for review May 28, 2024 20:56
@adityasa adityasa added the auto-merge Enables automation to merge PRs label May 29, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot merged commit 673bf58 into master May 29, 2024
22 checks passed
@microsoft-github-policy-service microsoft-github-policy-service bot deleted the users/adityasa/LimitBinaryToQueryOperations branch May 29, 2024 03:16
adityasa added a commit that referenced this pull request Jun 7, 2024
…ing binary format to query operations (#4515)

* Limit binary format to query operations

* Addressed comments, updated test.

* Updated coverage to include query stream API.

* Test Change.

* Test change 2

* ReadFeed Encryption tests only with project reference

* Revert

* Removed comment

---------

Co-authored-by: Matias Quaranta <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-merge Enables automation to merge PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants