-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
What problem are you facing?
The platform field of the client metadata is being set to:
"Node.js v16.13.0, LE (unified)|Node.js v16.13.0, LE (unified)"
the text after the vertical bar is supposed to be text from a driver wrapper or other custom driverInfo settings.
What driver and relevant dependency versions are you using?
Steps to reproduce?
connect a 4.x client to mongod and inspect the connection logs.
Acceptance Criteria
- Prevent many calls to makeClientMetadata from duplicating the platform string
- Refactor initial handshake generation.
- Add unit testing to cover makeClientMetadata
- Test that driverInfo options are appended only once
- Users can provide driverInfo name, version, and platform, which should be appended to the Node.js results of those properties separated by a bar character '|'
- Example: If I pass this driverInfo option into the MongoClient
{ driverInfo: { platform: 'myPlatform', name: 'myName', version: 'myVersion' } }
the metadata should have:
{ driver: { name: 'nodejs|myName', version: '4.7.0|myVersion' } platform: 'Node.js v16.13.0, LE (unified)|myPlatform' }
Each property (name, version, platform) is optional in driverInfo, we only append '|' + user data if passed a non-empty string.
- Assert the results always have the following shape: (See linked reference slides)
{ driver: { name: 'nodejs', version: '4.7.0' }, os: { type: 'Darwin', name: 'darwin', architecture: 'x64', version: '21.5.0' }, platform: 'Node.js v16.13.0, LE (unified)' }
There are no Sub-Tasks for this issue.