Repository navigation
CSHARP-6194: Preserve version-to-name mapping in client metadata - #2149
Open
adelinowona wants to merge 1 commit into
Open
adelinowona wants to merge 1 commit into
adelinowona wants to merge 1 commit into
Conversation
Appended library infos now always contribute one entry to each of driver.name and driver.version, using an empty entry for an unset version, so the two fields stay aligned by index (spec change DRIVERS-3251). Adds prose tests 10 and 11 from the handshake spec and updates the existing tests that encoded the old behavior.
adelinowona
requested review from
ajcvickers
and
a balanced review from Copilot
October 14, 2026 20:44
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused implementation preserves the required mapping and has relevant regression coverage, with no blocking issues identified.
0 open findings
What changed in this PR
Preserves index alignment between handshake driver names and versions by retaining empty version entries, including trailing entries.
Changes:
- Appends a version entry for every library.
- Updates unit expectations for missing versions.
- Adds prose tests for index alignment and delimiter rejection.
| File | Description |
|---|---|
| tests/MongoDB.Driver.Tests/Specifications/mongodb-handshake/prose-tests/MongoDbHandshakeProseTests.cs | Adds alignment and delimiter-rejection cases; updates expectations. |
| tests/MongoDB.Driver.Tests/Core/Connections/ClientMetadataTests.cs | Verifies missing versions retain their position. |
| tests/MongoDB.Driver.Tests/Core/Connections/ClientDocumentHelperTests.cs | Updates expected version strings. |
| src/MongoDB.Driver/Core/Connections/ClientDocumentHelper.cs | Preserves empty appended version entries. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
adelinowona
requested review from
BorisDog
and removed request for
ajcvickers
October 14, 2026 20:46
sanych-sun
approved these changes
Oct 15, 2026
| { | ||
| RequireServer.Check().Authentication(authentication: false); | ||
|
|
||
| var (name, version, platform) = testCase switch |
Member
There was a problem hiding this comment.
Should we have InlineData instead of this switch?
This branch has not been deployed
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.
CSHARP-6194 (split from DRIVERS-3251); spec change: mongodb/specifications#1975.
What
driver.nameanddriver.versionin the handshake must now correspond one-to-one by index. Previously an appended library with no version was skipped indriver.version, soF1 (1.5), F2 (no version), F3 (3.5)produced1.5|3.5and the version ofF3looked like it belonged toF2. An unset version now contributes an empty entry (1.5||3.5), and trailing empty entries are kept.The change itself is one line in
ClientDocumentHelper.AppendLibraryInfosToDriverDocument. The rest of the spec change already holds: duplicate detection compares the wholeLibraryInfo, andLibraryInforejects|in any field.