Skip to content

Commit

Permalink
feat(NODE-4509): send 1 with hello commands
Browse files Browse the repository at this point in the history
  • Loading branch information
durran committed Jan 3, 2023
1 parent b4e63fb commit ec0175f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/cmap/connect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ export function prepareHandshakeDocument(
const { serverApi } = authContext.connection;

const handshakeDoc: HandshakeDocument = {
[serverApi?.version ? 'hello' : LEGACY_HELLO_COMMAND]: true,
[serverApi?.version ? 'hello' : LEGACY_HELLO_COMMAND]: 1,
helloOk: true,
client: options.metadata || makeClientMetadata(options),
compression: compressors
Expand Down
2 changes: 1 addition & 1 deletion src/sdam/monitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ function checkServer(monitor: Monitor, callback: Callback<Document | null>) {
const isAwaitable = topologyVersion != null;

const cmd = {
[serverApi?.version || helloOk ? 'hello' : LEGACY_HELLO_COMMAND]: true,
[serverApi?.version || helloOk ? 'hello' : LEGACY_HELLO_COMMAND]: 1,
...(isAwaitable && topologyVersion
? { maxAwaitTimeMS, topologyVersion: makeTopologyVersion(topologyVersion) }
: {})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe('Handshake', function () {
// Execute legacy hello command
client
.db(configuration.db)
.command({ [LEGACY_HELLO_COMMAND]: true })
.command({ [LEGACY_HELLO_COMMAND]: 1 })
.then(function (result) {
test.ok(result !== null);

Expand Down

0 comments on commit ec0175f

Please sign in to comment.