From c5035f5e4b31506fe985ad05d8a218be18c43a32 Mon Sep 17 00:00:00 2001 From: Golfo Vasiliou Date: Tue, 10 Oct 2017 18:07:32 +0300 Subject: [PATCH 1/5] Changed ambiguous error message (#9161) Fixes #9019 --- packages/accounts-password/password_server.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/accounts-password/password_server.js b/packages/accounts-password/password_server.js index 93af180f05..689cf75f27 100644 --- a/packages/accounts-password/password_server.js +++ b/packages/accounts-password/password_server.js @@ -80,7 +80,7 @@ const handleError = (msg, throwError = true) => { const error = new Meteor.Error( 403, Accounts._options.ambiguousErrorMessages - ? "Login failure. Please check your login credentials." + ? "Something went wrong. Please check your credentials." : msg ); if (throwError) { From a3bba3a21dfea8598df7469f2232f2fe571a549f Mon Sep 17 00:00:00 2001 From: Ben Newman Date: Tue, 10 Oct 2017 11:08:45 -0400 Subject: [PATCH 2/5] Bump accounts-password package version to 1.4.1 to republish. --- packages/accounts-password/package.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/accounts-password/package.js b/packages/accounts-password/package.js index b8960d0472..88500d93d5 100644 --- a/packages/accounts-password/package.js +++ b/packages/accounts-password/package.js @@ -4,7 +4,7 @@ Package.describe({ // release process, so versions 2.0.0-beta.2 through -beta.5 and -rc.0 // have already been published. The next time this package reaches 2.x // territory, I would recommend jumping straight to 2.1.0. - version: "1.4.0" + version: "1.4.1" }); Package.onUse(function(api) { From 25679cef8d43dc2c92b98fc2482ccbae6b1532b7 Mon Sep 17 00:00:00 2001 From: seke Date: Tue, 3 Oct 2017 15:15:04 +0200 Subject: [PATCH 3/5] Fix for https://github.com/meteor/meteor/issues/9167 --- packages/minimongo/common.js | 4 ++-- packages/minimongo/minimongo_tests_client.js | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/minimongo/common.js b/packages/minimongo/common.js index 7aa0cafc27..4865ba4fbe 100644 --- a/packages/minimongo/common.js +++ b/packages/minimongo/common.js @@ -777,8 +777,8 @@ function getValueBitmask(value, length) { function insertIntoDocument(document, key, value) { Object.keys(document).forEach(existingKey => { if ( - (existingKey.length > key.length && existingKey.indexOf(key) === 0) || - (key.length > existingKey.length && key.indexOf(existingKey) === 0) + (existingKey.length > key.length && existingKey.indexOf(key + '.') === 0) || + (key.length > existingKey.length && key.indexOf(existingKey + '.') === 0) ) { throw new Error( `cannot infer query fields to set, both paths '${existingKey}' and ` + diff --git a/packages/minimongo/minimongo_tests_client.js b/packages/minimongo/minimongo_tests_client.js index 776af9aeac..03b2b9dc78 100644 --- a/packages/minimongo/minimongo_tests_client.js +++ b/packages/minimongo/minimongo_tests_client.js @@ -3006,7 +3006,10 @@ Tinytest.add('minimongo - modify', test => { upsert({"_id": "foo", "foo": "bar"}, {"bar": "foo"}, {"_id": "foo", "bar": "foo"}) // Replacement update keeps _id upsertUpdate({"_id": "foo", "bar": "baz"}, {"_id":"foo"}, {"bar": "crow"}, {"_id": "foo", "bar": "crow"}); - + // Test for https://github.com/meteor/meteor/issues/9167 + upsert({key: 123, keyName: '321'}, {$set: {name: 'Todo'}}, {key: 123, keyName: '321', name: 'Todo'}); + upsertException({key: 123, "key.name": '321'}, {$set:{}}); + // Nested fields don't work with literal objects upsertException({"a": {}, "a.b": "foo"}, {}); // You can't have an ambiguious ID From 9d59fe483511240de1d3f8cc155ac352f5217d18 Mon Sep 17 00:00:00 2001 From: Hugh Willson Date: Wed, 4 Oct 2017 10:44:27 -0400 Subject: [PATCH 4/5] Adjust to use template literals instead of string concatenation --- packages/minimongo/common.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/minimongo/common.js b/packages/minimongo/common.js index 4865ba4fbe..a0260feebb 100644 --- a/packages/minimongo/common.js +++ b/packages/minimongo/common.js @@ -777,8 +777,8 @@ function getValueBitmask(value, length) { function insertIntoDocument(document, key, value) { Object.keys(document).forEach(existingKey => { if ( - (existingKey.length > key.length && existingKey.indexOf(key + '.') === 0) || - (key.length > existingKey.length && key.indexOf(existingKey + '.') === 0) + (existingKey.length > key.length && existingKey.indexOf(`${key}.`) === 0) || + (key.length > existingKey.length && key.indexOf(`${existingKey}.`) === 0) ) { throw new Error( `cannot infer query fields to set, both paths '${existingKey}' and ` + From 5a6cb704adc594191a64dab8c414e545346b5a7f Mon Sep 17 00:00:00 2001 From: Ben Newman Date: Tue, 10 Oct 2017 11:37:27 -0400 Subject: [PATCH 5/5] Bump minimongo package version to 1.3.3 to republish. --- packages/minimongo/package.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/minimongo/package.js b/packages/minimongo/package.js index be335b504a..96a0f720d9 100644 --- a/packages/minimongo/package.js +++ b/packages/minimongo/package.js @@ -1,6 +1,6 @@ Package.describe({ summary: "Meteor's client-side datastore: a port of MongoDB to Javascript", - version: '1.3.2' + version: '1.3.3' }); Package.onUse(api => {