Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(NODE-6244): Bump max supported wire version and server version #4163

Merged
merged 4 commits into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/cmap/wire_protocol/constants.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export const MIN_SUPPORTED_SERVER_VERSION = '3.6';
export const MAX_SUPPORTED_SERVER_VERSION = '7.0';
export const MAX_SUPPORTED_SERVER_VERSION = '8.0';
export const MIN_SUPPORTED_WIRE_VERSION = 6;
export const MAX_SUPPORTED_WIRE_VERSION = 21;
export const MAX_SUPPORTED_WIRE_VERSION = 25;
export const MIN_SUPPORTED_QE_WIRE_VERSION = 21;
export const MIN_SUPPORTED_QE_SERVER_VERSION = '7.0';
export const OP_REPLY = 1;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
'use strict';
import { expect } from 'chai';

const mock = require('../../tools/mongodb-mock/index');
const { expect } = require('chai');
const { MongoServerSelectionError, MongoClient } = require('../../mongodb');
const { isHello } = require('../../mongodb');
import {
isHello,
MAX_SUPPORTED_WIRE_VERSION,
MIN_SUPPORTED_WIRE_VERSION,
MongoClient,
MongoServerSelectionError
} from '../../mongodb';
import * as mock from '../../tools/mongodb-mock/index';

const minCompatErrMsg = `minimum wire version ${
Number.MAX_SAFE_INTEGER - 1
}, but this version of the Node.js Driver requires at most 21`;
const maxCompatErrMsg = `reports maximum wire version 1, but this version of the Node.js Driver requires at least 6`;
}, but this version of the Node.js Driver requires at most ${MAX_SUPPORTED_WIRE_VERSION}`;
const maxCompatErrMsg = `reports maximum wire version 1, but this version of the Node.js Driver requires at least ${MIN_SUPPORTED_WIRE_VERSION}`;
durran marked this conversation as resolved.
Show resolved Hide resolved

describe('Wire Protocol Version', () => {
/** @type {mock.MockServer} */
let server, client;
let server, client: MongoClient;

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

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

/** @type {MongoClient} */
client = new MongoClient(
`mongodb://${server.uri()}/wireVersionTest?serverSelectionTimeoutMS=200`
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
const { expect } = require('chai');
const {
MIN_SUPPORTED_SERVER_VERSION,
import { expect } from 'chai';

import {
MAX_SUPPORTED_SERVER_VERSION,
MIN_SUPPORTED_WIRE_VERSION,
MAX_SUPPORTED_WIRE_VERSION
} = require('../../../mongodb');
MAX_SUPPORTED_WIRE_VERSION,
MIN_SUPPORTED_SERVER_VERSION,
MIN_SUPPORTED_WIRE_VERSION
} from '../../../mongodb';

describe('Wire Protocol Constants', function () {
describe('MIN_SUPPORTED_SERVER_VERSION', function () {
Expand All @@ -14,8 +15,8 @@ describe('Wire Protocol Constants', function () {
});

describe('MAX_SUPPORTED_SERVER_VERSION', function () {
it('returns 7.0', function () {
expect(MAX_SUPPORTED_SERVER_VERSION).to.equal('7.0');
it('returns 8.0', function () {
expect(MAX_SUPPORTED_SERVER_VERSION).to.equal('8.0');
});
});

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

describe('MAX_SUPPORTED_WIRE_VERSION', function () {
it('returns 21', function () {
expect(MAX_SUPPORTED_WIRE_VERSION).to.equal(21);
it('returns 25', function () {
expect(MAX_SUPPORTED_WIRE_VERSION).to.equal(25);
});
});
});