Skip to content

Fix Gateway V2 RID decoding#4803

Merged
tvaron3 merged 2 commits into
Azure:mainfrom
tvaron3:tvaron3-fix-cosmos-rid-decoding
Jul 20, 2026
Merged

Fix Gateway V2 RID decoding#4803
tvaron3 merged 2 commits into
Azure:mainfrom
tvaron3:tvaron3-fix-cosmos-rid-decoding

Conversation

@tvaron3

@tvaron3 tvaron3 commented Jul 17, 2026

Copy link
Copy Markdown
Member

Summary

  • decode collection RIDs using the Cosmos wire convention: standard Base64 with / represented as -
  • fail locally when a collection RID is invalid instead of silently omitting the required Gateway V2 ResourceId token
  • add exact-byte regression coverage for service-issued RIDs that exposed 400/13002

This matches Java ResourceId.fromBase64String and .NET ResourceIdentifier.FromBase64String, which both replace - with / before standard Base64 decoding.

Testing

  • cargo build -p azure_data_cosmos_driver --all-features
  • cargo test -p azure_data_cosmos_driver --lib --all-features (2,318 passed; 64 ignored)
  • cargo clippy -p azure_data_cosmos_driver --all-features --all-targets -- -D warnings
  • 20 Gateway V2 point-CRUD runs against thin-client-mwr-eventual-ci; all passed, including service-assigned mixed RID CkdDAP+-+xo= that the previous decoder could not handle

Use the canonical Cosmos RID decoder when emitting the binary ResourceId token. Invalid RIDs now fail locally instead of producing malformed Gateway V2 requests, and regression tests cover service-issued dashed RIDs.\n\nCo-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>\nCopilot-Session: 41611d83-71e5-40db-9b04-336baf40d423
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
2 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@github-actions github-actions Bot added the Cosmos The azure_cosmos crate label Jul 17, 2026
Associate the RID decoding correction with the existing Gateway 2.0 feature entries instead of adding a separate release-note line.\n\nCo-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>\nCopilot-Session: 41611d83-71e5-40db-9b04-336baf40d423
@tvaron3
tvaron3 marked this pull request as ready for review July 17, 2026 22:26
@tvaron3
tvaron3 requested a review from a team as a code owner July 17, 2026 22:26
Copilot AI review requested due to automatic review settings July 17, 2026 22:26
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
2 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@tvaron3

tvaron3 commented Jul 17, 2026

Copy link
Copy Markdown
Member Author

/azp run rust - cosmos - weekly

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes Gateway 2.0 collection RID decoding and routing-token generation.

Changes:

  • Uses the shared Cosmos wire-format RID decoder.
  • Adds exact-byte and invalid-RID regression tests.
  • Updates Gateway 2.0 release-note references.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
sdk/cosmos/azure_data_cosmos/CHANGELOG.md Updates Gateway 2.0 release notes.
sdk/cosmos/azure_data_cosmos_driver/CHANGELOG.md Updates driver release notes.
sdk/cosmos/azure_data_cosmos_driver/src/driver/transport/gateway_v2_dispatch.rs Corrects RID decoding, error handling, and tests.

Comment thread sdk/cosmos/azure_data_cosmos_driver/CHANGELOG.md
Comment thread sdk/cosmos/azure_data_cosmos/CHANGELOG.md
@tvaron3
tvaron3 merged commit 50394b3 into Azure:main Jul 20, 2026
39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Cosmos The azure_cosmos crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants