[Internal] Query : Fixes response parsing error for ReadFeed by limiting binary format to query operations #4515
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Closing issues
To automatically close an issue: closes #IssueNumber