Skip to content

Commit e813d3b

Browse files
committed
feat(NODE-3615): bump max wire version to 14
1 parent fb03738 commit e813d3b

15 files changed

+32
-32
lines changed

src/cmap/wire_protocol/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export const MIN_SUPPORTED_SERVER_VERSION = '3.6';
22
export const MAX_SUPPORTED_SERVER_VERSION = '5.1';
33
export const MIN_SUPPORTED_WIRE_VERSION = 6;
4-
export const MAX_SUPPORTED_WIRE_VERSION = 13;
4+
export const MAX_SUPPORTED_WIRE_VERSION = 14;
55
export const OP_REPLY = 1;
66
export const OP_UPDATE = 2001;
77
export const OP_INSERT = 2002;

test/functional/collection.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,7 @@ describe('Collection', function () {
637637
}
638638

639639
if (doc.ismaster || doc.hello) {
640-
request.reply(Object.assign({}, mock.DEFAULT_ISMASTER));
640+
request.reply(Object.assign({}, mock.DEFAULT_ISMASTER_36));
641641
} else if (doc.endSessions) {
642642
request.reply({ ok: 1 });
643643
}

test/functional/unit-sdam/monitoring.test.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ describe('monitoring', function () {
2626
mockServer.setMessageHandler(request => {
2727
const doc = request.document;
2828
if (doc.ismaster || doc.hello) {
29-
request.reply(Object.assign({}, mock.DEFAULT_ISMASTER));
29+
request.reply(Object.assign({}, mock.DEFAULT_ISMASTER_36));
3030
} else if (doc.endSessions) {
3131
request.reply({ ok: 1 });
3232
}
@@ -65,7 +65,7 @@ describe('monitoring', function () {
6565

6666
const doc = request.document;
6767
if (doc.ismaster || doc.hello) {
68-
request.reply(Object.assign({}, mock.DEFAULT_ISMASTER));
68+
request.reply(Object.assign({}, mock.DEFAULT_ISMASTER_36));
6969
} else if (doc.endSessions) {
7070
request.reply({ ok: 1 });
7171
}
@@ -92,7 +92,7 @@ describe('monitoring', function () {
9292
mockServer.setMessageHandler(request => {
9393
const doc = request.document;
9494
if (doc.ismaster || doc.hello) {
95-
request.reply(Object.assign({}, mock.DEFAULT_ISMASTER));
95+
request.reply(Object.assign({}, mock.DEFAULT_ISMASTER_36));
9696
}
9797
});
9898

@@ -109,7 +109,7 @@ describe('monitoring', function () {
109109
mockServer.setMessageHandler(request => {
110110
const doc = request.document;
111111
if (doc.ismaster || doc.hello) {
112-
request.reply(Object.assign({}, mock.DEFAULT_ISMASTER));
112+
request.reply(Object.assign({}, mock.DEFAULT_ISMASTER_36));
113113
}
114114
});
115115

@@ -127,7 +127,7 @@ describe('monitoring', function () {
127127
mockServer.setMessageHandler(request => {
128128
const doc = request.document;
129129
if (doc.ismaster || doc.hello) {
130-
setTimeout(() => request.reply(Object.assign({}, mock.DEFAULT_ISMASTER)), 250);
130+
setTimeout(() => request.reply(Object.assign({}, mock.DEFAULT_ISMASTER_36)), 250);
131131
}
132132
});
133133

@@ -218,7 +218,7 @@ describe('monitoring', function () {
218218
done();
219219
} else if (doc.ismaster || doc.hello) {
220220
setTimeout(
221-
() => request.reply(Object.assign({ helloOk: true }, mock.DEFAULT_ISMASTER)),
221+
() => request.reply(Object.assign({ helloOk: true }, mock.DEFAULT_ISMASTER_36)),
222222
250
223223
);
224224
}

test/functional/unit-sdam/topology.test.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ describe('Topology (unit)', function () {
4141
const doc = request.document;
4242
if (doc.ismaster || doc.hello) {
4343
ismasters.push(doc);
44-
request.reply(mock.DEFAULT_ISMASTER);
44+
request.reply(mock.DEFAULT_ISMASTER_36);
4545
} else {
4646
request.reply({ ok: 1 });
4747
}
@@ -110,7 +110,7 @@ describe('Topology (unit)', function () {
110110
setTimeout(() => {
111111
this.emit(
112112
'descriptionReceived',
113-
new ServerDescription('someserver:27019', { ok: 1, maxWireVersion: 5 })
113+
new ServerDescription('someserver:27019', { ok: 1, maxWireVersion: 6 })
114114
);
115115
}, 20);
116116
});
@@ -130,7 +130,7 @@ describe('Topology (unit)', function () {
130130
setTimeout(() => {
131131
this.emit(
132132
'descriptionReceived',
133-
new ServerDescription(this.name, { ok: 1, msg: 'isdbgrid', maxWireVersion: 5 })
133+
new ServerDescription(this.name, { ok: 1, msg: 'isdbgrid', maxWireVersion: 6 })
134134
);
135135
}, 20);
136136
});
@@ -188,7 +188,7 @@ describe('Topology (unit)', function () {
188188
mockServer.setMessageHandler(request => {
189189
const doc = request.document;
190190
if (doc.ismaster || doc.hello) {
191-
request.reply(Object.assign({}, mock.DEFAULT_ISMASTER, { maxWireVersion: 9 }));
191+
request.reply(Object.assign({}, mock.DEFAULT_ISMASTER_36, { maxWireVersion: 9 }));
192192
} else if (doc.insert) {
193193
request.reply({ ok: 0, message: 'node is recovering', code: 11600 });
194194
} else {
@@ -225,7 +225,7 @@ describe('Topology (unit)', function () {
225225
mockServer.setMessageHandler(request => {
226226
const doc = request.document;
227227
if (doc.ismaster || doc.hello) {
228-
request.reply(Object.assign({}, mock.DEFAULT_ISMASTER, { maxWireVersion: 9 }));
228+
request.reply(Object.assign({}, mock.DEFAULT_ISMASTER_36, { maxWireVersion: 9 }));
229229
} else if (doc.insert) {
230230
request.reply({ ok: 0, message: 'not master' });
231231
} else {
@@ -262,7 +262,7 @@ describe('Topology (unit)', function () {
262262
mockServer.setMessageHandler(request => {
263263
const doc = request.document;
264264
if (doc.ismaster || doc.hello) {
265-
request.reply(Object.assign({}, mock.DEFAULT_ISMASTER, { maxWireVersion: 9 }));
265+
request.reply(Object.assign({}, mock.DEFAULT_ISMASTER_36, { maxWireVersion: 9 }));
266266
} else if (doc.insert) {
267267
request.connection.destroy();
268268
} else {

test/functional/unit_bypass_validation.test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ describe('bypass document validation', function () {
3939
}
4040

4141
if (doc.ismaster || doc.hello) {
42-
request.reply(Object.assign({}, mock.DEFAULT_ISMASTER));
42+
request.reply(Object.assign({}, mock.DEFAULT_ISMASTER_36));
4343
} else if (doc.endSessions) {
4444
request.reply({ ok: 1 });
4545
}
@@ -92,7 +92,7 @@ describe('bypass document validation', function () {
9292
}
9393

9494
if (doc.ismaster || doc.hello) {
95-
request.reply(Object.assign({}, mock.DEFAULT_ISMASTER));
95+
request.reply(Object.assign({}, mock.DEFAULT_ISMASTER_36));
9696
} else if (doc.endSessions) {
9797
request.reply({ ok: 1 });
9898
}
@@ -149,7 +149,7 @@ describe('bypass document validation', function () {
149149
}
150150

151151
if (doc.ismaster || doc.hello) {
152-
request.reply(Object.assign({}, mock.DEFAULT_ISMASTER));
152+
request.reply(Object.assign({}, mock.DEFAULT_ISMASTER_36));
153153
} else if (doc.endSessions) {
154154
request.reply({ ok: 1 });
155155
}
@@ -198,7 +198,7 @@ describe('bypass document validation', function () {
198198
}
199199

200200
if (doc.ismaster || doc.hello) {
201-
request.reply(Object.assign({}, mock.DEFAULT_ISMASTER));
201+
request.reply(Object.assign({}, mock.DEFAULT_ISMASTER_36));
202202
} else if (doc.endSessions) {
203203
request.reply({ ok: 1 });
204204
}

test/functional/unit_create_index_error.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ describe('CreateIndexError', function () {
2020
const doc = request.document;
2121

2222
if (doc.ismaster || doc.hello) {
23-
return request.reply(Object.assign({}, mock.DEFAULT_ISMASTER));
23+
return request.reply(Object.assign({}, mock.DEFAULT_ISMASTER_36));
2424
}
2525

2626
if (doc.createIndexes) {

test/functional/unit_db_list_collections.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ describe('db.listCollections', function () {
1212
const doc = request.document;
1313

1414
if (doc.ismaster || doc.hello) {
15-
return request.reply(Object.assign({}, mock.DEFAULT_ISMASTER));
15+
return request.reply(Object.assign({}, mock.DEFAULT_ISMASTER_36));
1616
}
1717

1818
if (doc.listCollections) {

test/functional/write_concern.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ describe('Write Concern', function () {
9999
it('should pipe writeConcern from client down to API call', function () {
100100
server.setMessageHandler(request => {
101101
if (request.document && request.document.ismaster) {
102-
return request.reply(mock.DEFAULT_ISMASTER);
102+
return request.reply(mock.DEFAULT_ISMASTER_36);
103103
}
104104
expect(request.document.writeConcern).to.exist;
105105
expect(request.document.writeConcern.w).to.equal('majority');

test/unit/_MISC_scram_iterations.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ describe('SCRAM Iterations Tests', function () {
3535
server.setMessageHandler(request => {
3636
const doc = request.document;
3737
if (doc.ismaster || doc.hello) {
38-
return request.reply(Object.assign({}, mock.DEFAULT_ISMASTER));
38+
return request.reply(Object.assign({}, mock.DEFAULT_ISMASTER_36));
3939
} else if (doc.saslStart) {
4040
return request.reply({
4141
ok: 1,

test/unit/cmap/connect.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ describe('Connect Tests', function () {
3838
if (doc.ismaster || doc.hello) {
3939
whatHappened.ismaster = true;
4040
request.reply(
41-
Object.assign({}, mock.DEFAULT_ISMASTER, {
41+
Object.assign({}, mock.DEFAULT_ISMASTER_36, {
4242
$clusterTime
4343
})
4444
);
@@ -68,7 +68,7 @@ describe('Connect Tests', function () {
6868
if (doc.ismaster || doc.hello) {
6969
whatHappened.ismaster = true;
7070
request.reply(
71-
Object.assign({}, mock.DEFAULT_ISMASTER, {
71+
Object.assign({}, mock.DEFAULT_ISMASTER_36, {
7272
$clusterTime,
7373
arbiterOnly: true
7474
})

test/unit/cmap/wire_protocol/constants.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ describe('Wire Protocol Constants', function () {
2626
});
2727

2828
describe('MAX_SUPPORTED_WIRE_VERSION', function () {
29-
it('returns 13', function () {
30-
expect(MAX_SUPPORTED_WIRE_VERSION).to.equal(13);
29+
it('returns 14', function () {
30+
expect(MAX_SUPPORTED_WIRE_VERSION).to.equal(14);
3131
});
3232
});
3333
});

test/unit/sessions.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ describe('Sessions - unit/core', function () {
227227
var doc = request.document;
228228
if (doc.ismaster || doc.hello) {
229229
request.reply(
230-
Object.assign({}, mock.DEFAULT_ISMASTER, { logicalSessionTimeoutMinutes: 10 })
230+
Object.assign({}, mock.DEFAULT_ISMASTER_36, { logicalSessionTimeoutMinutes: 10 })
231231
);
232232
}
233233
});

test/unit/unit_client.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ describe('Client (unit)', function () {
2121
const doc = request.document;
2222
if (doc.ismaster || doc.hello) {
2323
handshake = doc;
24-
request.reply(Object.assign({}, mock.DEFAULT_ISMASTER));
24+
request.reply(Object.assign({}, mock.DEFAULT_ISMASTER_36));
2525
} else if (doc.endSessions) {
2626
request.reply({ ok: 1 });
2727
}

test/unit/unit_snappy.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ describe('Compression', function () {
3838
server.setMessageHandler(request => {
3939
const doc = request.document;
4040
if (doc.ismaster || doc.hello) {
41-
return request.reply({ ...mock.DEFAULT_ISMASTER, compression: ['snappy'] });
41+
return request.reply({ ...mock.DEFAULT_ISMASTER_36, compression: ['snappy'] });
4242
}
4343
if (doc.insert === 'snappy') {
4444
return request.reply({ ok: 1 });

test/unit/unit_wire_version.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ const { MongoServerSelectionError, MongoClient } = require('../../src');
66

77
const minCompatErrMsg = `minimum wire version ${
88
Number.MAX_SAFE_INTEGER - 1
9-
}, but this version of the Node.js Driver requires at most 13`;
10-
const maxCompatErrMsg = `reports maximum wire version 6, but this version of the Node.js Driver requires at least 6`;
9+
}, but this version of the Node.js Driver requires at most 14`;
10+
const maxCompatErrMsg = `reports maximum wire version 1, but this version of the Node.js Driver requires at least 6`;
1111

1212
describe('Wire Protocol Version', () => {
1313
/** @type {mock.MockServer} */
@@ -35,7 +35,7 @@ describe('Wire Protocol Version', () => {
3535
await mock.cleanup();
3636
});
3737

38-
describe('minimum is greater than 13', () => {
38+
describe('minimum is greater than 14', () => {
3939
it('should raise a compatibility error', async function () {
4040
setWireProtocolMessageHandler(Number.MAX_SAFE_INTEGER - 1, Number.MAX_SAFE_INTEGER);
4141

0 commit comments

Comments
 (0)