From 291bb356b23696d7c7d62f1a71802c7882699bc4 Mon Sep 17 00:00:00 2001 From: greenkeeperio-bot Date: Mon, 18 Jul 2016 19:37:01 -0700 Subject: [PATCH 1/5] chore(package): update mongodb to version 2.2.4 https://greenkeeper.io/ --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b32fd77392..1e9c8d0215 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "lru-cache": "4.0.1", "mailgun-js": "0.7.10", "mime": "1.3.4", - "mongodb": "2.1.18", + "mongodb": "2.2.4", "multer": "1.1.0", "parse": "1.9.0", "parse-server-fs-adapter": "1.0.0", From 867384febf0b7b1d98d53e4ef22f7e8a6343c2cd Mon Sep 17 00:00:00 2001 From: Florent Vilmart Date: Tue, 19 Jul 2016 10:38:03 -0400 Subject: [PATCH 2/5] fix for mongo 2.2.4 --- spec/index.spec.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spec/index.spec.js b/spec/index.spec.js index cb5ea1afe3..3d8236299b 100644 --- a/spec/index.spec.js +++ b/spec/index.spec.js @@ -65,6 +65,8 @@ describe('server', () => { expect(response.statusCode).toEqual(500); expect(body.code).toEqual(1); expect(body.message).toEqual('Internal server error.'); + // Reconfigure with null so the next beforeEach don't fail trying to delete + reconfigureServer({ databaseAdapter: null }); done(); }); }); From b3671dfa25590f64f27430caa2fe8830cdc25b00 Mon Sep 17 00:00:00 2001 From: Florent Vilmart Date: Tue, 19 Jul 2016 17:21:22 -0400 Subject: [PATCH 3/5] Delete schema promise on error... - Just because this way we can let the adapter an opportunity to yield a new error.... OR A SUCCESS --- src/Controllers/DatabaseController.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Controllers/DatabaseController.js b/src/Controllers/DatabaseController.js index 5272f9bfd0..cf64caa0bf 100644 --- a/src/Controllers/DatabaseController.js +++ b/src/Controllers/DatabaseController.js @@ -110,7 +110,8 @@ DatabaseController.prototype.validateClassName = function(className) { DatabaseController.prototype.loadSchema = function() { if (!this.schemaPromise) { this.schemaPromise = SchemaController.load(this.adapter); - this.schemaPromise.then(() => delete this.schemaPromise); + this.schemaPromise.then(() => delete this.schemaPromise, + () => delete this.schemaPromise); } return this.schemaPromise; }; From c825e71ce7a3d6373f079a0bc09a7639d84cdc7a Mon Sep 17 00:00:00 2001 From: Florent Vilmart Date: Tue, 19 Jul 2016 19:52:20 -0400 Subject: [PATCH 4/5] Fixes test --- spec/index.spec.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/spec/index.spec.js b/spec/index.spec.js index 3d8236299b..cb5ea1afe3 100644 --- a/spec/index.spec.js +++ b/spec/index.spec.js @@ -65,8 +65,6 @@ describe('server', () => { expect(response.statusCode).toEqual(500); expect(body.code).toEqual(1); expect(body.message).toEqual('Internal server error.'); - // Reconfigure with null so the next beforeEach don't fail trying to delete - reconfigureServer({ databaseAdapter: null }); done(); }); }); From c455a3f1afa50a35d70c7e9667945e41a9c6a9c1 Mon Sep 17 00:00:00 2001 From: Florent Vilmart Date: Tue, 19 Jul 2016 20:03:29 -0400 Subject: [PATCH 5/5] Restore fix --- spec/index.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/index.spec.js b/spec/index.spec.js index cb5ea1afe3..b5e4b26b36 100644 --- a/spec/index.spec.js +++ b/spec/index.spec.js @@ -65,7 +65,7 @@ describe('server', () => { expect(response.statusCode).toEqual(500); expect(body.code).toEqual(1); expect(body.message).toEqual('Internal server error.'); - done(); + reconfigureServer().then(done, done); }); }); });