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

[BUG]: Inconsistent Results in Gateway Mode for Resource IDs with Special Characters. #4954

Open
aavasthy opened this issue Jan 8, 2025 · 0 comments

Comments

@aavasthy
Copy link
Contributor

aavasthy commented Jan 8, 2025

We are continuously addressing and improving the SDK, if possible, make sure the problem persist in the latest SDK version.

Describe the bug
In Gateway Mode, certain queries or ReadItemAsync calls to Azure Cosmos DB return empty results or fail to retrieve documents, even though the documents exist in the database. The issue occurs when resource IDs or query parameters contain special characters (e.g., + | < > $ \ /). The same operations work correctly in Direct Mode. After switching back to Direct Mode, all queries return the correct results. This issue prevents consistent use of Gateway Mode.

To Reproduce
Create a document in Azure Cosmos DB with an ID containing special characters, such as ">test" or "%3Etest".
Attempt to retrieve the document using:

var document = await _cosmosContainer.ReadItemAsync<TDocument>(
    id: id,
    partitionKey: new PartitionKey(id),
    cancellationToken: cancellationToken);

Perform the same operation in both Direct Mode and Gateway Mode.

Expected behavior
Direct Mode: The document should be successfully retrieved.
Gateway Mode: The document should also be successfully retrieved, matching the behavior of Direct Mode.

Actual behavior
Direct Mode: The document is retrieved as expected.
Gateway Mode: The query or ReadItemAsync call returns empty results or fails to retrieve the document.

Environment summary
SDK Version: 3.46.0
OS Version (e.g. Windows, Linux, MacOSX)

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

No branches or pull requests

1 participant