Skip to content

Commit 2c2fafb

Browse files
authored
Merge branch 'alpha' into update-redis
2 parents 9e3050e + 9af9115 commit 2c2fafb

10 files changed

+119
-115
lines changed

.github/workflows/ci.yml

Lines changed: 27 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
pull_request:
66
branches: [ release, alpha, beta ]
77
env:
8-
NODE_VERSION: 18.1.0
8+
NODE_VERSION: 18.12.1
99
PARSE_SERVER_TEST_TIMEOUT: 20000
1010
jobs:
1111
check-code-analysis:
@@ -32,7 +32,7 @@ jobs:
3232
check-ci:
3333
name: Node Engine Check
3434
timeout-minutes: 15
35-
runs-on: ubuntu-20.04
35+
runs-on: ubuntu-latest
3636
steps:
3737
- uses: actions/checkout@v2
3838
- name: Use Node.js ${{ matrix.NODE_VERSION }}
@@ -53,7 +53,7 @@ jobs:
5353
check-lint:
5454
name: Lint
5555
timeout-minutes: 15
56-
runs-on: ubuntu-20.04
56+
runs-on: ubuntu-latest
5757
steps:
5858
- uses: actions/checkout@v2
5959
- name: Use Node.js ${{ matrix.NODE_VERSION }}
@@ -73,7 +73,7 @@ jobs:
7373
check-circular:
7474
name: Circular Dependencies
7575
timeout-minutes: 5
76-
runs-on: ubuntu-20.04
76+
runs-on: ubuntu-latest
7777
steps:
7878
- uses: actions/checkout@v2
7979
- name: Use Node.js ${{ matrix.NODE_VERSION }}
@@ -93,7 +93,7 @@ jobs:
9393
check-docker:
9494
name: Docker Build
9595
timeout-minutes: 15
96-
runs-on: ubuntu-20.04
96+
runs-on: ubuntu-latest
9797
steps:
9898
- name: Checkout repository
9999
uses: actions/checkout@v2
@@ -110,7 +110,7 @@ jobs:
110110
check-lock-file-version:
111111
name: NPM Lock File Version
112112
timeout-minutes: 5
113-
runs-on: ubuntu-20.04
113+
runs-on: ubuntu-latest
114114
steps:
115115
- uses: actions/checkout@v2
116116
- name: Check NPM lock file version
@@ -121,56 +121,39 @@ jobs:
121121
strategy:
122122
matrix:
123123
include:
124-
- name: MongoDB 4.0, Standalone, MMAPv1
125-
MONGODB_VERSION: 4.0.28
126-
MONGODB_TOPOLOGY: standalone
127-
MONGODB_STORAGE_ENGINE: mmapv1
128-
NODE_VERSION: 18.1.0
129-
- name: MongoDB 4.0, ReplicaSet, WiredTiger
130-
MONGODB_VERSION: 4.0.28
131-
MONGODB_TOPOLOGY: replicaset
132-
MONGODB_STORAGE_ENGINE: wiredTiger
133-
NODE_VERSION: 18.1.0
134-
- name: MongoDB 4.2, ReplicaSet, WiredTiger
124+
- name: MongoDB 4.2, ReplicaSet
135125
MONGODB_VERSION: 4.2.19
136126
MONGODB_TOPOLOGY: replicaset
137-
MONGODB_STORAGE_ENGINE: wiredTiger
138-
NODE_VERSION: 18.1.0
139-
- name: MongoDB 4.4, ReplicaSet, WiredTiger
127+
NODE_VERSION: 18.12.1
128+
- name: MongoDB 4.4, ReplicaSet
140129
MONGODB_VERSION: 4.4.13
141130
MONGODB_TOPOLOGY: replicaset
142-
MONGODB_STORAGE_ENGINE: wiredTiger
143-
NODE_VERSION: 18.1.0
144-
- name: MongoDB 5, ReplicaSet, WiredTiger
131+
NODE_VERSION: 18.12.1
132+
- name: MongoDB 5, ReplicaSet
145133
MONGODB_VERSION: 5.3.2
146134
MONGODB_TOPOLOGY: replicaset
147-
MONGODB_STORAGE_ENGINE: wiredTiger
148-
NODE_VERSION: 18.1.0
149-
- name: MongoDB 6, ReplicaSet, WiredTiger
135+
NODE_VERSION: 18.12.1
136+
- name: MongoDB 6, ReplicaSet
150137
MONGODB_VERSION: 6.0.2
151138
MONGODB_TOPOLOGY: replicaset
152-
MONGODB_STORAGE_ENGINE: wiredTiger
153-
NODE_VERSION: 18.1.0
139+
NODE_VERSION: 18.12.1
154140
- name: Redis Cache
155141
PARSE_SERVER_TEST_CACHE: redis
156142
MONGODB_VERSION: 4.4.13
157143
MONGODB_TOPOLOGY: standalone
158-
MONGODB_STORAGE_ENGINE: wiredTiger
159-
NODE_VERSION: 18.1.0
144+
NODE_VERSION: 18.12.1
160145
- name: Node 14
161146
MONGODB_VERSION: 4.4.13
162147
MONGODB_TOPOLOGY: standalone
163-
MONGODB_STORAGE_ENGINE: wiredTiger
164-
NODE_VERSION: 14.21.0
148+
NODE_VERSION: 14.21.1
165149
- name: Node 16
166150
MONGODB_VERSION: 4.4.13
167151
MONGODB_TOPOLOGY: standalone
168-
MONGODB_STORAGE_ENGINE: wiredTiger
169-
NODE_VERSION: 16.14.2
152+
NODE_VERSION: 16.18.1
170153
fail-fast: false
171154
name: ${{ matrix.name }}
172155
timeout-minutes: 15
173-
runs-on: ubuntu-20.04
156+
runs-on: ubuntu-latest
174157
services:
175158
redis:
176159
image: redis
@@ -210,32 +193,32 @@ jobs:
210193
include:
211194
- name: PostgreSQL 11, PostGIS 3.0
212195
POSTGRES_IMAGE: postgis/postgis:11-3.0
213-
NODE_VERSION: 18.1.0
196+
NODE_VERSION: 18.12.1
214197
- name: PostgreSQL 11, PostGIS 3.1
215198
POSTGRES_IMAGE: postgis/postgis:11-3.1
216-
NODE_VERSION: 18.1.0
199+
NODE_VERSION: 18.12.1
217200
- name: PostgreSQL 11, PostGIS 3.2
218201
POSTGRES_IMAGE: postgis/postgis:11-3.2
219-
NODE_VERSION: 18.1.0
202+
NODE_VERSION: 18.12.1
220203
- name: PostgreSQL 11, PostGIS 3.3
221204
POSTGRES_IMAGE: postgis/postgis:11-3.3
222-
NODE_VERSION: 18.1.0
205+
NODE_VERSION: 18.12.1
223206
- name: PostgreSQL 12, PostGIS 3.3
224207
POSTGRES_IMAGE: postgis/postgis:12-3.3
225-
NODE_VERSION: 18.1.0
208+
NODE_VERSION: 18.12.1
226209
- name: PostgreSQL 13, PostGIS 3.3
227210
POSTGRES_IMAGE: postgis/postgis:13-3.3
228-
NODE_VERSION: 18.1.0
211+
NODE_VERSION: 18.12.1
229212
- name: PostgreSQL 14, PostGIS 3.3
230213
POSTGRES_IMAGE: postgis/postgis:14-3.3
231-
NODE_VERSION: 18.1.0
214+
NODE_VERSION: 18.12.1
232215
- name: PostgreSQL 15, PostGIS 3.3
233216
POSTGRES_IMAGE: postgis/postgis:15-3.3
234-
NODE_VERSION: 18.1.0
217+
NODE_VERSION: 18.12.1
235218
fail-fast: false
236219
name: ${{ matrix.name }}
237220
timeout-minutes: 15
238-
runs-on: ubuntu-20.04
221+
runs-on: ubuntu-latest
239222
services:
240223
redis:
241224
image: redis

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
[![Coverage](https://img.shields.io/codecov/c/github/parse-community/parse-server/alpha.svg)](https://codecov.io/github/parse-community/parse-server?branch=alpha)
1010
[![auto-release](https://img.shields.io/badge/%F0%9F%9A%80-auto--release-9e34eb.svg)](https://github.com/parse-community/parse-dashboard/releases)
1111

12-
[![Node Version](https://img.shields.io/badge/nodejs-12,_14,_16,_17,_18-green.svg?logo=node.js&style=flat)](https://nodejs.org)
12+
[![Node Version](https://img.shields.io/badge/nodejs-14,_16,_18-green.svg?logo=node.js&style=flat)](https://nodejs.org)
1313
[![MongoDB Version](https://img.shields.io/badge/mongodb-4.0,_4.2,_4.4,_5,_6-green.svg?logo=mongodb&style=flat)](https://www.mongodb.com)
1414
[![Postgres Version](https://img.shields.io/badge/postgresql-11,_12,_13,_14,_15-green.svg?logo=postgresql&style=flat)](https://www.postgresql.org)
1515

changelogs/CHANGELOG_alpha.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
1+
# [6.0.0-alpha.6](https://github.com/parse-community/parse-server/compare/6.0.0-alpha.5...6.0.0-alpha.6) (2022-11-10)
2+
3+
4+
### Features
5+
6+
* Remove support for MongoDB 4.0 ([#8292](https://github.com/parse-community/parse-server/issues/8292)) ([37245f6](https://github.com/parse-community/parse-server/commit/37245f62ce83516b6b95a54b850f0274ef680478))
7+
8+
9+
### BREAKING CHANGES
10+
11+
* This release removes support for MongoDB 4.0; the new minimum supported MongoDB version is 4.2. which also removes support for the deprecated MongoDB MMAPv1 storage engine ([37245f6](37245f6))
12+
13+
# [6.0.0-alpha.5](https://github.com/parse-community/parse-server/compare/6.0.0-alpha.4...6.0.0-alpha.5) (2022-11-10)
14+
15+
16+
### Bug Fixes
17+
18+
* Throwing error in Cloud Code Triggers `afterLogin`, `afterLogout` crashes server ([#8280](https://github.com/parse-community/parse-server/issues/8280)) ([130d290](https://github.com/parse-community/parse-server/commit/130d29074e3f763460e5685d0b9059e5a333caff))
19+
20+
21+
### BREAKING CHANGES
22+
23+
* Throwing an error in Cloud Code Triggers `afterLogin`, `afterLogout` returns a rejected promise; in previous releases it crashed the server if you did not handle the error on the Node.js process level; consider adapting your code if your app currently handles these errors on the Node.js process level with `process.on('unhandledRejection', ...)` ([130d290](130d290))
24+
125
# [6.0.0-alpha.4](https://github.com/parse-community/parse-server/compare/6.0.0-alpha.3...6.0.0-alpha.4) (2022-11-10)
226

327

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "parse-server",
3-
"version": "6.0.0-alpha.4",
3+
"version": "6.0.0-alpha.6",
44
"description": "An express module providing a Parse-compatible API server",
55
"main": "lib/index.js",
66
"repository": {
@@ -112,20 +112,19 @@
112112
"lint-fix": "eslint --fix --cache ./",
113113
"build": "babel src/ -d lib/ --copy-files",
114114
"watch": "babel --watch src/ -d lib/ --copy-files",
115-
"test:mongodb:runnerstart": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=$npm_config_dbversion} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} MONGODB_STORAGE_ENGINE=${MONGODB_STORAGE_ENGINE:=wiredTiger} mongodb-runner start",
116-
"test:mongodb:testonly": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=$npm_config_dbversion} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} MONGODB_STORAGE_ENGINE=${MONGODB_STORAGE_ENGINE:=wiredTiger} TESTING=1 jasmine",
115+
"test:mongodb:runnerstart": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=$npm_config_dbversion} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} mongodb-runner start",
116+
"test:mongodb:testonly": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=$npm_config_dbversion} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} TESTING=1 jasmine",
117117
"test:mongodb": "npm run test:mongodb:runnerstart --dbversion=$npm_config_dbversion && npm run test:mongodb:testonly --dbversion=$npm_config_dbversion",
118-
"test:mongodb:4.0.28": "npm run test:mongodb --dbversion=4.0.28",
119118
"test:mongodb:4.2.19": "npm run test:mongodb --dbversion=4.2.19",
120119
"test:mongodb:4.4.13": "npm run test:mongodb --dbversion=4.4.13",
121120
"test:mongodb:5.3.2": "npm run test:mongodb --dbversion=5.3.2",
122121
"test:mongodb:6.0.2": "npm run test:mongodb --dbversion=6.0.2",
123122
"posttest:mongodb": "mongodb-runner stop",
124-
"pretest": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=5.3.2} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} MONGODB_STORAGE_ENGINE=${MONGODB_STORAGE_ENGINE:=wiredTiger} mongodb-runner start",
125-
"testonly": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=5.3.2} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} MONGODB_STORAGE_ENGINE=${MONGODB_STORAGE_ENGINE:=wiredTiger} TESTING=1 jasmine",
123+
"pretest": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=5.3.2} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} mongodb-runner start",
124+
"testonly": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=5.3.2} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} TESTING=1 jasmine",
126125
"test": "npm run testonly",
127-
"posttest": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=5.3.2} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} MONGODB_STORAGE_ENGINE=${MONGODB_STORAGE_ENGINE:=wiredTiger} mongodb-runner stop",
128-
"coverage": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=5.3.2} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} MONGODB_STORAGE_ENGINE=${MONGODB_STORAGE_ENGINE:=wiredTiger} TESTING=1 nyc jasmine",
126+
"posttest": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=5.3.2} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} mongodb-runner stop",
127+
"coverage": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=5.3.2} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} TESTING=1 nyc jasmine",
129128
"start": "node ./bin/parse-server",
130129
"prettier": "prettier --write {src,spec}/{**/*,*}.js",
131130
"prepare": "npm run build",

spec/CloudCode.spec.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3103,6 +3103,36 @@ describe('beforeLogin hook', () => {
31033103
done();
31043104
});
31053105

3106+
it('does not crash server when throwing in afterLogin hook', async () => {
3107+
const error = new Parse.Error(2000, 'afterLogin error');
3108+
const trigger = {
3109+
afterLogin() {
3110+
throw error;
3111+
},
3112+
};
3113+
const spy = spyOn(trigger, 'afterLogin').and.callThrough();
3114+
Parse.Cloud.afterLogin(trigger.afterLogin);
3115+
await Parse.User.signUp('user', 'pass');
3116+
const response = await Parse.User.logIn('user', 'pass').catch(e => e);
3117+
expect(spy).toHaveBeenCalled();
3118+
expect(response).toEqual(error);
3119+
});
3120+
3121+
it('does not crash server when throwing in afterLogout hook', async () => {
3122+
const error = new Parse.Error(2000, 'afterLogout error');
3123+
const trigger = {
3124+
afterLogout() {
3125+
throw error;
3126+
},
3127+
};
3128+
const spy = spyOn(trigger, 'afterLogout').and.callThrough();
3129+
Parse.Cloud.afterLogout(trigger.afterLogout);
3130+
await Parse.User.signUp('user', 'pass');
3131+
const response = await Parse.User.logOut().catch(e => e);
3132+
expect(spy).toHaveBeenCalled();
3133+
expect(response).toEqual(error);
3134+
});
3135+
31063136
it('should have expected data in request', async done => {
31073137
Parse.Cloud.beforeLogin(req => {
31083138
expect(req.object).toBeDefined();

spec/MongoStorageAdapter.spec.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ const databaseURI = 'mongodb://localhost:27017/parseServerMongoAdapterTestDataba
66
const request = require('../lib/request');
77
const Config = require('../lib/Config');
88
const TestUtils = require('../lib/TestUtils');
9-
const semver = require('semver');
109

1110
const fakeClient = {
1211
s: { options: { dbName: null } },
@@ -401,11 +400,7 @@ describe_only_db('mongo')('MongoStorageAdapter', () => {
401400
expect(schemaAfterDeletion.fields.test).toBeUndefined();
402401
});
403402

404-
if (
405-
semver.satisfies(process.env.MONGODB_VERSION, '>=4.0.4') &&
406-
process.env.MONGODB_TOPOLOGY === 'replicaset' &&
407-
process.env.MONGODB_STORAGE_ENGINE === 'wiredTiger'
408-
) {
403+
if (process.env.MONGODB_TOPOLOGY === 'replicaset') {
409404
describe('transactions', () => {
410405
const headers = {
411406
'Content-Type': 'application/json',

spec/ParseServerRESTController.spec.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ const ParseServerRESTController = require('../lib/ParseServerRESTController')
22
.ParseServerRESTController;
33
const ParseServer = require('../lib/ParseServer').default;
44
const Parse = require('parse/node').Parse;
5-
const semver = require('semver');
65
const TestUtils = require('../lib/TestUtils');
76

87
let RESTController;
@@ -130,19 +129,13 @@ describe('ParseServerRESTController', () => {
130129
});
131130

132131
if (
133-
(semver.satisfies(process.env.MONGODB_VERSION, '>=4.0.4') &&
134-
process.env.MONGODB_TOPOLOGY === 'replicaset' &&
135-
process.env.MONGODB_STORAGE_ENGINE === 'wiredTiger') ||
132+
process.env.MONGODB_TOPOLOGY === 'replicaset' ||
136133
process.env.PARSE_SERVER_TEST_DB === 'postgres'
137134
) {
138135
describe('transactions', () => {
139136
beforeEach(async () => {
140137
await TestUtils.destroyAllDataPermanently(true);
141-
if (
142-
semver.satisfies(process.env.MONGODB_VERSION, '>=4.0.4') &&
143-
process.env.MONGODB_TOPOLOGY === 'replicaset' &&
144-
process.env.MONGODB_STORAGE_ENGINE === 'wiredTiger'
145-
) {
138+
if (process.env.MONGODB_TOPOLOGY === 'replicaset') {
146139
await reconfigureServer({
147140
databaseAdapter: undefined,
148141
databaseURI:

spec/batch.spec.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
const batch = require('../lib/batch');
22
const request = require('../lib/request');
3-
const semver = require('semver');
43
const TestUtils = require('../lib/TestUtils');
54

65
const originalURL = '/parse/batch';
@@ -206,19 +205,13 @@ describe('batch', () => {
206205
});
207206

208207
if (
209-
(semver.satisfies(process.env.MONGODB_VERSION, '>=4.0.4') &&
210-
process.env.MONGODB_TOPOLOGY === 'replicaset' &&
211-
process.env.MONGODB_STORAGE_ENGINE === 'wiredTiger') ||
208+
process.env.MONGODB_TOPOLOGY === 'replicaset' ||
212209
process.env.PARSE_SERVER_TEST_DB === 'postgres'
213210
) {
214211
describe('transactions', () => {
215212
beforeEach(async () => {
216213
await TestUtils.destroyAllDataPermanently(true);
217-
if (
218-
semver.satisfies(process.env.MONGODB_VERSION, '>=4.0.4') &&
219-
process.env.MONGODB_TOPOLOGY === 'replicaset' &&
220-
process.env.MONGODB_STORAGE_ENGINE === 'wiredTiger'
221-
) {
214+
if (process.env.MONGODB_TOPOLOGY === 'replicaset') {
222215
await reconfigureServer({
223216
databaseAdapter: undefined,
224217
databaseURI:

0 commit comments

Comments
 (0)