-
Type:
Task
-
Resolution: Unresolved
-
Priority:
Unknown
-
None
-
Component/s: Handshake, Networking
-
Needed
-
Summary
As discussed in https://mongodb.slack.com/archives/C72LB5RPV/p1754510550358959, with the existing ClientMetadata appending API, some frameworks might instantiate objects with the same mongo client. This would result in duplicated metadata for the same framework.
We should somehow ensure that we only append client metadata if the new metadata has not already been appended to the client's metadata.
Motivation
Who is the affected end user?
Driver engineers integrating with 3rd party libraries.
How does this affect the end user?
We might see duplicate framework entries in the server logs for the framework, depending on whether or not a client is shared across multiple framework abstractions. (ex: the same MongoClient being used for multiple VectorStores in langchainjs might result in `langchainjs` being appending to the metadata multiple times).
How likely is it that this problem or use case will occur?
Pretty likely - I know we'll encounter this in langchainjs and it seems like the Python team has encountered this in their integrations as well.
If the problem does occur, what are the consequences and how severe are they?
unsure - I'm not sure how the analytics team parses handshake metadata but I'd want to confirm that this problem wouldn't result in duplicated analytics being reported.
Is this issue urgent?
not urgent.
Is this ticket required by a downstream team?
no.
Is this ticket only for tests?
no.
Acceptance Criteria
- Add spec language and tests to ensure that client metadata is only appended to the driver's existing metadata if the new metadata has not already been appended.
- The spec change should allow appending metadata with a distinct version of a library for which metadata has already been captured (and have an explicit test for this case)
- related to
-
DRIVERS-2985 Allow Instantiated MongoClients to Send Client Metadata On-Demand
-
- In Progress
-
-
PYTHON-5488 `append_metadata` should not add duplicates
-
- Closed
-
- split to
-
CDRIVER-6089 Avoid appending the same metadata multiple times in appendClientMetadata()
-
- Blocked
-
-
CSHARP-5721 Avoid appending the same metadata multiple times in appendClientMetadata()
-
- Blocked
-
-
CXX-3341 Avoid appending the same metadata multiple times in appendClientMetadata()
-
- Blocked
-
-
GODRIVER-3653 Avoid appending the same metadata multiple times in appendClientMetadata()
-
- Blocked
-
-
JAVA-5955 Avoid appending the same metadata multiple times in appendClientMetadata()
-
- Blocked
-
-
PHPLIB-1718 Avoid appending the same metadata multiple times in appendClientMetadata()
-
- Blocked
-
-
PYTHON-5526 Avoid appending the same metadata multiple times in appendClientMetadata()
-
- Blocked
-
-
RUBY-3704 Avoid appending the same metadata multiple times in appendClientMetadata()
-
- Blocked
-
-
RUST-2272 Avoid appending the same metadata multiple times in appendClientMetadata()
-
- Blocked
-
-
NODE-7138 Avoid appending the same metadata multiple times in appendClientMetadata()
-
- In Code Review
-