Skip to content

Commit 5206d9c

Browse files
committed
chore: comments
1 parent 818d71e commit 5206d9c

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/mongo_client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ export class MongoClient extends TypedEventEmitter<MongoClientEvents> implements
493493
*/
494494
appendMetadata(driverInfo: DriverInfo) {
495495
for (const info of this.options.additionalDriverInfo) {
496-
if (info.name === driverInfo.name) {
496+
if (info.name === driverInfo.name && info.version === driverInfo.version) {
497497
return;
498498
}
499499
}

test/integration/mongodb-handshake/mongodb-handshake.prose.test.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,12 +356,18 @@ describe('Client Metadata Update Prose Tests', function () {
356356
expect(updatedClientMetadata.os).to.deep.equal(initialClientMetadata.os);
357357
});
358358

359-
it('does not append duplicate metadata for the same name', async function () {
359+
it('does not append duplicate metadata for the same name and version', async function () {
360360
client.appendMetadata({ name, version, platform });
361361
client.appendMetadata({ name, version, platform });
362362
await client.db('test').command({ ping: 1 });
363363
expect(updatedClientMetadata.driver.name).to.not.contain('|framework|framework');
364364
});
365+
366+
it('appends metadata when the version differs', async function () {
367+
client.appendMetadata({ name, version: '0.0', platform });
368+
await client.db('test').command({ ping: 1 });
369+
expect(updatedClientMetadata.driver.name).to.not.contain('0.0');
370+
});
365371
});
366372
}
367373
});

0 commit comments

Comments
 (0)