From 432c6bfa3089c5e2092ad4d6ec9d02d2fa4becef Mon Sep 17 00:00:00 2001 From: greenkeeperio-bot Date: Wed, 11 Jan 2017 02:44:40 -0800 Subject: [PATCH 1/3] chore(package): update mongodb to version 2.2.20 https://greenkeeper.io/ --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 434bbde2b1..2e9aa90145 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "lodash": "4.17.4", "lru-cache": "4.0.2", "mime": "1.3.4", - "mongodb": "2.2.10", + "mongodb": "2.2.20", "multer": "1.2.1", "parse": "1.9.2", "parse-server-fs-adapter": "1.0.1", From 4fb5d2407f25e6740286af3d3ac422c607ded40c Mon Sep 17 00:00:00 2001 From: Florent Vilmart Date: Thu, 12 Jan 2017 21:12:49 -0500 Subject: [PATCH 2/3] Fix race when fetching schema frequently --- spec/ParseQuery.spec.js | 3 ++- spec/ParseRelation.spec.js | 9 +++++++++ src/Controllers/SchemaController.js | 16 ++++++++++------ 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/spec/ParseQuery.spec.js b/spec/ParseQuery.spec.js index 45e522e761..b17d58366c 100644 --- a/spec/ParseQuery.spec.js +++ b/spec/ParseQuery.spec.js @@ -1631,8 +1631,9 @@ describe('Parse.Query testing', () => { }); expect(total).toBe(0); done() - }, () => { + }, (e) => { fail('should not fail'); + fail(JSON.stringify(e)); done(); }) }); diff --git a/spec/ParseRelation.spec.js b/spec/ParseRelation.spec.js index 6adbe38450..2702d4c70a 100644 --- a/spec/ParseRelation.spec.js +++ b/spec/ParseRelation.spec.js @@ -575,6 +575,9 @@ describe('Parse.Relation testing', () => { expect(result.get('key').get('even')).toBe(false); }); done(); + }, (e) => { + fail(JSON.stringify(e)); + done(); }) }); @@ -613,6 +616,9 @@ describe('Parse.Relation testing', () => { done(); } })); + }, (e) => { + fail(JSON.stringify(e)); + done(); }); }); @@ -653,6 +659,9 @@ describe('Parse.Relation testing', () => { done(); } })); + }, (e) => { + fail(JSON.stringify(e)); + done(); }); }); diff --git a/src/Controllers/SchemaController.js b/src/Controllers/SchemaController.js index 9eee5ca458..f94f4a1629 100644 --- a/src/Controllers/SchemaController.js +++ b/src/Controllers/SchemaController.js @@ -333,25 +333,29 @@ export default class SchemaController { if (this.reloadDataPromise && !options.clearCache) { return this.reloadDataPromise; } - this.data = {}; - this.perms = {}; this.reloadDataPromise = promise.then(() => { return this.getAllClasses(options); }) .then(allSchemas => { + const data = {}; + const perms = {}; allSchemas.forEach(schema => { - this.data[schema.className] = injectDefaultSchema(schema).fields; - this.perms[schema.className] = schema.classLevelPermissions; + data[schema.className] = injectDefaultSchema(schema).fields; + perms[schema.className] = schema.classLevelPermissions; }); // Inject the in-memory classes volatileClasses.forEach(className => { const schema = injectDefaultSchema({ className }); - this.data[className] = schema.fields; - this.perms[className] = schema.classLevelPermissions; + data[className] = schema.fields; + perms[className] = schema.classLevelPermissions; }); + this.data = data; + this.perms = perms; delete this.reloadDataPromise; }, (err) => { + this.data = {}; + this.perms = {}; delete this.reloadDataPromise; throw err; }); From a3f2a7384c04fa04394ed5fcb16a84eb4519a3ed Mon Sep 17 00:00:00 2001 From: Florent Vilmart Date: Fri, 13 Jan 2017 16:20:06 -0500 Subject: [PATCH 3/3] Bumps mongo to 2.2.21 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2e9aa90145..512d28b052 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "lodash": "4.17.4", "lru-cache": "4.0.2", "mime": "1.3.4", - "mongodb": "2.2.20", + "mongodb": "2.2.21", "multer": "1.2.1", "parse": "1.9.2", "parse-server-fs-adapter": "1.0.1",