diff --git a/History.md b/History.md index ac14a8813e..3405f4f551 100644 --- a/History.md +++ b/History.md @@ -4,6 +4,10 @@ * Updated `ddp-server@2.3.3` and `socket-stream-client@0.3.2` dependencies which removes Node's HTTP deprecation warning. +* Released `ddp-client@2.4.1` re-ordering fields in DDP message for better client readability. + +* Released `mongo@1.11.1` fixing a `Timestamp.ONE is undefined` bug. + ## v2.2, 2021-04-15 #### Highlights diff --git a/packages/accounts-password/password_server.js b/packages/accounts-password/password_server.js index 0ac3d27d21..f9000e9db3 100644 --- a/packages/accounts-password/password_server.js +++ b/packages/accounts-password/password_server.js @@ -276,7 +276,12 @@ const userQueryValidator = Match.Where(user => { return true; }); -const passwordValidator = { digest: String, algorithm: String }; +const passwordValidator = Match.OneOf( + Match.Where(str => Match.test(str, String) && str.length <= Meteor.settings?.packages?.accounts?.passwordMaxLength || 256), { + digest: Match.Where(str => Match.test(str, String) && str.length === 64), + algorithm: Match.OneOf('sha-256') + } +); // Handler to login with a password. // diff --git a/packages/ddp-client/common/livedata_connection.js b/packages/ddp-client/common/livedata_connection.js index 320e4d60f9..5e0eb6a1bb 100644 --- a/packages/ddp-client/common/livedata_connection.js +++ b/packages/ddp-client/common/livedata_connection.js @@ -692,9 +692,9 @@ export class Connection { // wrote. const message = { msg: 'method', + id: methodId, method: name, - params: args, - id: methodId + params: args }; // If an exception occurred in a stub, and we're ignoring it diff --git a/packages/ddp-client/package.js b/packages/ddp-client/package.js index 1d5b5a5bcd..ff13d25b8e 100644 --- a/packages/ddp-client/package.js +++ b/packages/ddp-client/package.js @@ -1,6 +1,6 @@ Package.describe({ summary: "Meteor's latency-compensated distributed data client", - version: '2.4.0', + version: '2.4.1', documentation: null }); diff --git a/packages/minimongo/minimongo_tests_client.js b/packages/minimongo/minimongo_tests_client.js index 95526acaea..1e369c8d06 100644 --- a/packages/minimongo/minimongo_tests_client.js +++ b/packages/minimongo/minimongo_tests_client.js @@ -2234,7 +2234,7 @@ Tinytest.add('minimongo - nested array sort', test => { c.insert({ ab0x: 6, ab0x_g: 6, g_ab0x: 6, cdx: 8, cdx_cdy: 8, cdy_cdx: 2, n: 6 , a: { b: [{ x: 2.5 }] }, c: { d: [{x: 2, y: 2}, {x: 3}] }, g: 4 }); c.insert({ ab0x: 7, ab0x_g: 7, g_ab0x: 7, cdx: 4, cdx_cdy: 4, cdy_cdx: 6, n: 7 , a: { b: [{ x: 5 }] }, c: { d: [{ y: 2}, { y: 3}] }, g: 5 }); c.insert({ ab0x: 8, ab0x_g: 8, g_ab0x: 8, cdx: 5, cdx_cdy: 5, cdy_cdx: 7, n: 8 , a: { b: [{ x: 6 }, { x: 7 }] }, c: { d: [{ y: 2}, { x: 1.5, y: 2}] }, g: 6 }); - + // Test that the the documents in "cursor" contain values with the name // "field" running from 0 to the max value of that name in the collection. const testCursorMatchesField = (cursor, field) => { @@ -2254,7 +2254,7 @@ Tinytest.add('minimongo - nested array sort', test => { testCursorMatchesField(c.find({}, { sort: { 'c.d.x': 1 } }), 'cdx'); testCursorMatchesField(c.find({}, { sort: { 'c.d.x': 1, 'c.d.y': 1 } }), 'cdx_cdy'); testCursorMatchesField(c.find({}, { sort: { 'c.d.y': 1, 'c.d.x': 1 } }), 'cdy_cdx'); - + }); Tinytest.add('minimongo - sort keys', test => { @@ -2312,7 +2312,7 @@ Tinytest.add('minimongo - sort keys', test => { testKeys({'a.0.x': 1}, {a: [{x: 0}]}, [[0]]); - + testKeys({'a.0.x': 1}, {a: []}, [[undefined]]); @@ -2673,10 +2673,10 @@ Tinytest.add('minimongo - modify', test => { exception({a: false}, {$mul: {a: 10}}); exception({a: null}, {$mul: {a: 10}}); exception({}, {$mul: {_id: 1}}); - modify({a: [1, 2]}, {$mul: {'a.1': 2}}, {a: [2, 1]}); - modify({a: [1, 2]}, {$mul: {'a.1': 3}}, {a: [3, 2]}); - modify({a: [1, 2]}, {$mul: {'a.2': 10}}, {a: [1, 20]}); - modify({a: [1, 2]}, {$mul: {'a.3': 10}}, {a: [1, 2, 0]}); + modify({a: [1, 2]}, {$mul: {'a.0': 2}}, {a: [2, 2]}); + modify({a: [1, 2]}, {$mul: {'a.1': 3}}, {a: [1, 6]}); + modify({a: [1, 2]}, {$mul: {'a.1': 10}}, {a: [1, 20]}); + modify({a: [1, 2]}, {$mul: {'a.2': 10}}, {a: [1, 2, 0]}); modify({a: {b: 2}}, {$mul: {'a.b': 1}}, {a: {b: 2}}); modify({a: {b: 2}}, {$mul: {'a.c': 10}}, {a: {b: 2, c: 0}}); diff --git a/packages/mongo/oplog_tailing.js b/packages/mongo/oplog_tailing.js index 7d2b2fea10..698e9ce4c0 100644 --- a/packages/mongo/oplog_tailing.js +++ b/packages/mongo/oplog_tailing.js @@ -1,7 +1,7 @@ var Future = Npm.require('fibers/future'); import { NpmModuleMongodb } from "meteor/npm-mongo"; -const { Timestamp } = NpmModuleMongodb; +const { Long } = NpmModuleMongodb; OPLOG_COLLECTION = 'oplog.rs'; @@ -278,7 +278,7 @@ _.extend(OplogHandle.prototype, { // See https://github.com/meteor/meteor/issues/10420. if (!op.ts) { op.ts = nextTimestamp; - nextTimestamp = nextTimestamp.add(Timestamp.ONE); + nextTimestamp = nextTimestamp.add(Long.ONE); } handleDoc(op); }); diff --git a/packages/mongo/package.js b/packages/mongo/package.js index 8be1541d3f..3a7807aca0 100644 --- a/packages/mongo/package.js +++ b/packages/mongo/package.js @@ -9,7 +9,7 @@ Package.describe({ summary: "Adaptor for using MongoDB and Minimongo over DDP", - version: '1.11.0' + version: '1.11.1' }); Npm.depends({ diff --git a/tools/cli/default-npm-deps.js b/tools/cli/default-npm-deps.js index b7a3392434..d34c1a702e 100644 --- a/tools/cli/default-npm-deps.js +++ b/tools/cli/default-npm-deps.js @@ -13,7 +13,8 @@ export function install(appDir, options) { const needTempPackageJson = ! statOrNull(packageJsonPath); if (needTempPackageJson) { - const { dependencies } = require("../static-assets/skel-minimal/package.json"); + // NOTE we need skel-minimal to pull in jQuery which right now is required for Blaze + const { dependencies } = require("../static-assets/skel-blaze/package.json"); // Write a minimial package.json with the same dependencies as the // default new-app package.json file.