Skip to content

Commit 45bc098

Browse files
authored
feat(NODE-6244): Bump max supported wire version and server version (#4163)
1 parent 25c84a4 commit 45bc098

File tree

3 files changed

+25
-23
lines changed

3 files changed

+25
-23
lines changed

src/cmap/wire_protocol/constants.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export const MIN_SUPPORTED_SERVER_VERSION = '3.6';
2-
export const MAX_SUPPORTED_SERVER_VERSION = '7.0';
2+
export const MAX_SUPPORTED_SERVER_VERSION = '8.0';
33
export const MIN_SUPPORTED_WIRE_VERSION = 6;
4-
export const MAX_SUPPORTED_WIRE_VERSION = 21;
4+
export const MAX_SUPPORTED_WIRE_VERSION = 25;
55
export const MIN_SUPPORTED_QE_WIRE_VERSION = 21;
66
export const MIN_SUPPORTED_QE_SERVER_VERSION = '7.0';
77
export const OP_REPLY = 1;

test/unit/assorted/wire_version.test.js renamed to test/unit/assorted/wire_version.test.ts

+12-11
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
1-
'use strict';
1+
import { expect } from 'chai';
22

3-
const mock = require('../../tools/mongodb-mock/index');
4-
const { expect } = require('chai');
5-
const { MongoServerSelectionError, MongoClient } = require('../../mongodb');
6-
const { isHello } = require('../../mongodb');
3+
import {
4+
isHello,
5+
MAX_SUPPORTED_WIRE_VERSION,
6+
MIN_SUPPORTED_WIRE_VERSION,
7+
MongoClient,
8+
MongoServerSelectionError
9+
} from '../../mongodb';
10+
import * as mock from '../../tools/mongodb-mock/index';
711

812
const minCompatErrMsg = `minimum wire version ${
913
Number.MAX_SAFE_INTEGER - 1
10-
}, but this version of the Node.js Driver requires at most 21`;
11-
const maxCompatErrMsg = `reports maximum wire version 1, but this version of the Node.js Driver requires at least 6`;
14+
}, but this version of the Node.js Driver requires at most ${MAX_SUPPORTED_WIRE_VERSION}`;
15+
const maxCompatErrMsg = `reports maximum wire version 1, but this version of the Node.js Driver requires at least ${MIN_SUPPORTED_WIRE_VERSION}`;
1216

1317
describe('Wire Protocol Version', () => {
14-
/** @type {mock.MockServer} */
15-
let server, client;
18+
let server, client: MongoClient;
1619

1720
function setWireProtocolMessageHandler(min, max) {
1821
server.setMessageHandler(req => {
@@ -41,7 +44,6 @@ describe('Wire Protocol Version', () => {
4144
it('should raise a compatibility error', async function () {
4245
setWireProtocolMessageHandler(Number.MAX_SAFE_INTEGER - 1, Number.MAX_SAFE_INTEGER);
4346

44-
/** @type {MongoClient} */
4547
client = new MongoClient(
4648
`mongodb://${server.uri()}/wireVersionTest?serverSelectionTimeoutMS=200`
4749
);
@@ -59,7 +61,6 @@ describe('Wire Protocol Version', () => {
5961
it('should raise a compatibility error', async function () {
6062
setWireProtocolMessageHandler(1, 1);
6163

62-
/** @type {MongoClient} */
6364
client = new MongoClient(
6465
`mongodb://${server.uri()}/wireVersionTest?serverSelectionTimeoutMS=200`
6566
);
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
const { expect } = require('chai');
2-
const {
3-
MIN_SUPPORTED_SERVER_VERSION,
1+
import { expect } from 'chai';
2+
3+
import {
44
MAX_SUPPORTED_SERVER_VERSION,
5-
MIN_SUPPORTED_WIRE_VERSION,
6-
MAX_SUPPORTED_WIRE_VERSION
7-
} = require('../../../mongodb');
5+
MAX_SUPPORTED_WIRE_VERSION,
6+
MIN_SUPPORTED_SERVER_VERSION,
7+
MIN_SUPPORTED_WIRE_VERSION
8+
} from '../../../mongodb';
89

910
describe('Wire Protocol Constants', function () {
1011
describe('MIN_SUPPORTED_SERVER_VERSION', function () {
@@ -14,8 +15,8 @@ describe('Wire Protocol Constants', function () {
1415
});
1516

1617
describe('MAX_SUPPORTED_SERVER_VERSION', function () {
17-
it('returns 7.0', function () {
18-
expect(MAX_SUPPORTED_SERVER_VERSION).to.equal('7.0');
18+
it('returns 8.0', function () {
19+
expect(MAX_SUPPORTED_SERVER_VERSION).to.equal('8.0');
1920
});
2021
});
2122

@@ -26,8 +27,8 @@ describe('Wire Protocol Constants', function () {
2627
});
2728

2829
describe('MAX_SUPPORTED_WIRE_VERSION', function () {
29-
it('returns 21', function () {
30-
expect(MAX_SUPPORTED_WIRE_VERSION).to.equal(21);
30+
it('returns 25', function () {
31+
expect(MAX_SUPPORTED_WIRE_VERSION).to.equal(25);
3132
});
3233
});
3334
});

0 commit comments

Comments
 (0)