Fix Gateway V2 RID decoding#4803
Merged
Merged
Conversation
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: 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. |
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
|
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. |
Member
Author
|
/azp run rust - cosmos - weekly |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
Contributor
There was a problem hiding this comment.
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. |
analogrelay
approved these changes
Jul 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
/represented as-ResourceIdtoken400/13002This matches Java
ResourceId.fromBase64Stringand .NETResourceIdentifier.FromBase64String, which both replace-with/before standard Base64 decoding.Testing
cargo build -p azure_data_cosmos_driver --all-featurescargo 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 warningsthin-client-mwr-eventual-ci; all passed, including service-assigned mixed RIDCkdDAP+-+xo=that the previous decoder could not handle