Skip to content

Commit 6f060e0

Browse files
davimacedoTomWFox
andauthored
Release 4.3.0 (#6811)
* Release version 4.3.0 * Update CHANGELOG.md Co-authored-by: Tom Fox <[email protected]> * Update CHANGELOG.md Co-authored-by: Tom Fox <[email protected]> * Update CHANGELOG.md Co-authored-by: Tom Fox <[email protected]> * Update CHANGELOG.md Co-authored-by: Tom Fox <[email protected]> Co-authored-by: Tom Fox <[email protected]>
1 parent d698333 commit 6f060e0

File tree

5 files changed

+101
-57
lines changed

5 files changed

+101
-57
lines changed

CHANGELOG.md

Lines changed: 40 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,46 @@
11
## Parse Server Changelog
22

33
### master
4-
[Full Changelog](https://github.com/parse-community/parse-server/compare/4.2.0...master)
5-
- FIX: Optimize query decoration based on pointer CLPs by looking at the class schema to determine the field's type.
6-
- NEW (EXPERIMENTAL): Idempotency enforcement for client requests. This deduplicates requests where the client intends to send one request to Parse Server but due to network issues the server receives the request multiple times. **Caution, this is an experimental feature that may not be appropriate for production.** [#6744](https://github.com/parse-community/parse-server/issues/6744). Thanks to [Manuel Trezza](https://github.com/mtrezza).
4+
[Full Changelog](https://github.com/parse-community/parse-server/compare/4.3.0...master)
5+
6+
### 4.3.0
7+
[Full Changelog](https://github.com/parse-community/parse-server/compare/4.2.0...4.3.0)
8+
- PERFORMANCE: Optimizing pointer CLP query decoration done by DatabaseController#addPointerPermissions [#6747](https://github.com/parse-community/parse-server/pull/6747). Thanks to [mess-lelouch](https://github.com/mess-lelouch).
9+
- SECURITY: Fix security breach on GraphQL viewer. Thanks to [Antoine Cormouls](https://github.com/Moumouls).
10+
- FIX: Save context not present if direct access enabled [#6764](https://github.com/parse-community/parse-server/pull/6764). Thanks to [Omair Vaiyani](https://github.com/omairvaiyani).
11+
- NEW: Before Connect + Before Subscribe [#6793](https://github.com/parse-community/parse-server/pull/6793). Thanks to [dblythy](https://github.com/dblythy).
12+
- FIX: Add version to playground to fix CDN [#6804](https://github.com/parse-community/parse-server/pull/6804). Thanks to [Antoine Cormouls](https://github.com/Moumouls).
13+
- NEW (EXPERIMENTAL): Idempotency enforcement for client requests. This deduplicates requests where the client intends to send one request to Parse Server but due to network issues the server receives the request multiple times. **Caution, this is an experimental feature that may not be appropriate for production.** [#6748](https://github.com/parse-community/parse-server/issues/6748). Thanks to [Manuel Trezza](https://github.com/mtrezza).
14+
- FIX: Add production Google Auth Adapter instead of using the development url [#6734](https://github.com/parse-community/parse-server/pull/6734). Thanks to [SebC.](https://github.com/SebC99).
15+
- IMPROVE: Run Prettier JS Again Without requiring () on arrow functions [#6796](https://github.com/parse-community/parse-server/pull/6796). Thanks to [Diamond Lewis](https://github.com/dplewis).
16+
- IMPROVE: Run Prettier JS [#6795](https://github.com/parse-community/parse-server/pull/6795). Thanks to [Diamond Lewis](https://github.com/dplewis).
17+
- IMPROVE: Replace bcrypt with @node-rs/bcrypt [#6794](https://github.com/parse-community/parse-server/pull/6794). Thanks to [LongYinan](https://github.com/Brooooooklyn).
18+
- IMPROVE: Make clear description of anonymous user [#6655](https://github.com/parse-community/parse-server/pull/6655). Thanks to [Jerome De Leon](https://github.com/JeromeDeLeon).
19+
- IMPROVE: Simplify GraphQL merge system to avoid js ref bugs [#6791](https://github.com/parse-community/parse-server/pull/6791). Thanks to [Manuel](https://github.com/mtrezza).
20+
- NEW: Pass context in beforeDelete, afterDelete, beforeFind and Parse.Cloud.run [#6666](https://github.com/parse-community/parse-server/pull/6666). Thanks to [yog27ray](https://github.com/yog27ray).
21+
- NEW: Allow passing custom gql schema function to ParseServer#start options [#6762](https://github.com/parse-community/parse-server/pull/6762). Thanks to [Luca](https://github.com/lucatk).
22+
- NEW: Allow custom cors origin header [#6772](https://github.com/parse-community/parse-server/pull/6772). Thanks to [Kevin Yao](https://github.com/kzmeyao).
23+
- FIX: Fix context for cascade-saving and saving existing object [#6735](https://github.com/parse-community/parse-server/pull/6735). Thanks to [Manuel](https://github.com/mtrezza).
24+
- NEW: Add file bucket encryption using fileKey [#6765](https://github.com/parse-community/parse-server/pull/6765). Thanks to [Corey Baker](https://github.com/cbaker6).
25+
- FIX: Removed gaze from dev dependencies and removed not working dev script [#6745](https://github.com/parse-community/parse-server/pull/6745). Thanks to [Vincent Semrau](https://github.com/vince1995).
26+
- IMPROVE: Upgrade graphql-tools to v6 [#6701](https://github.com/parse-community/parse-server/pull/6701). Thanks to [Yaacov Rydzinski](https://github.com/yaacovCR).
27+
- NEW: Support Metadata in GridFSAdapter [#6660](https://github.com/parse-community/parse-server/pull/6660). Thanks to [Diamond Lewis](https://github.com/dplewis).
28+
- NEW: Allow to unset file from graphql [#6651](https://github.com/parse-community/parse-server/pull/6651). Thanks to [Antoine Cormouls](https://github.com/Moumouls).
29+
- NEW: Handle shutdown for RedisCacheAdapter [#6658](https://github.com/parse-community/parse-server/pull/6658). Thanks to [promisenxu](https://github.com/promisenxu).
30+
- FIX: Fix explain on user class [#6650](https://github.com/parse-community/parse-server/pull/6650). Thanks to [Manuel](https://github.com/mtrezza).
31+
- FIX: Fix read preference for aggregate [#6585](https://github.com/parse-community/parse-server/pull/6585). Thanks to [Manuel](https://github.com/mtrezza).
32+
- NEW: Add context to Parse.Object.save [#6626](https://github.com/parse-community/parse-server/pull/6626). Thanks to [Manuel](https://github.com/mtrezza).
33+
- NEW: Adding ssl config params to Postgres URI [#6580](https://github.com/parse-community/parse-server/pull/6580). Thanks to [Corey Baker](https://github.com/cbaker6).
34+
- FIX: Travis postgres update: removing unnecessary start of mongo-runner [#6594](https://github.com/parse-community/parse-server/pull/6594). Thanks to [Corey Baker](https://github.com/cbaker6).
35+
- FIX: ObjectId size for Pointer in Postgres [#6619](https://github.com/parse-community/parse-server/pull/6619). Thanks to [Corey Baker](https://github.com/cbaker6).
36+
- IMPROVE: Improve a test case [#6629](https://github.com/parse-community/parse-server/pull/6629). Thanks to [Gordon Sun](https://github.com/sunshineo).
37+
- NEW: Allow to resolve automatically Parse Type fields from Custom Schema [#6562](https://github.com/parse-community/parse-server/pull/6562). Thanks to [Antoine Cormouls](https://github.com/Moumouls).
38+
- FIX: Remove wrong console log in test [#6627](https://github.com/parse-community/parse-server/pull/6627). Thanks to [Gordon Sun](https://github.com/sunshineo).
39+
- IMPROVE: Graphql tools v5 [#6611](https://github.com/parse-community/parse-server/pull/6611). Thanks to [Yaacov Rydzinski](https://github.com/yaacovCR).
40+
- FIX: Catch JSON.parse and return 403 properly [#6589](https://github.com/parse-community/parse-server/pull/6589). Thanks to [Gordon Sun](https://github.com/sunshineo).
41+
- PERFORMANCE: Allow covering relation queries with minimal index [#6581](https://github.com/parse-community/parse-server/pull/6581). Thanks to [Noah Silas](https://github.com/noahsilas).
42+
- FIX: Fix Postgres group aggregation [#6522](https://github.com/parse-community/parse-server/pull/6522). Thanks to [Siddharth Ramesh](https://github.com/srameshr).
43+
- NEW: Allow set user mapped from JWT directly on request [#6411](https://github.com/parse-community/parse-server/pull/6411). Thanks to [Gordon Sun](https://github.com/sunshineo).
744

845
### 4.2.0
946
[Full Changelog](https://github.com/parse-community/parse-server/compare/4.1.0...4.2.0)

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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "parse-server",
3-
"version": "4.2.0",
3+
"version": "4.3.0",
44
"description": "An express module providing a Parse-compatible API server",
55
"main": "lib/index.js",
66
"repository": {

spec/DatabaseController.spec.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const validateQuery = DatabaseController._validateQuery;
33

44
describe('DatabaseController', function () {
55
describe('validateQuery', function () {
6-
it('should not restructure simple cases of SERVER-13732', (done) => {
6+
it('should not restructure simple cases of SERVER-13732', done => {
77
const query = {
88
$or: [{ a: 1 }, { a: 2 }],
99
_rperm: { $in: ['a', 'b'] },
@@ -18,7 +18,7 @@ describe('DatabaseController', function () {
1818
done();
1919
});
2020

21-
it('should not restructure SERVER-13732 queries with $nears', (done) => {
21+
it('should not restructure SERVER-13732 queries with $nears', done => {
2222
let query = { $or: [{ a: 1 }, { b: 1 }], c: { $nearSphere: {} } };
2323
validateQuery(query);
2424
expect(query).toEqual({
@@ -31,7 +31,7 @@ describe('DatabaseController', function () {
3131
done();
3232
});
3333

34-
it('should not push refactored keys down a tree for SERVER-13732', (done) => {
34+
it('should not push refactored keys down a tree for SERVER-13732', done => {
3535
const query = {
3636
a: 1,
3737
$or: [{ $or: [{ b: 1 }, { b: 2 }] }, { $or: [{ c: 1 }, { c: 2 }] }],
@@ -45,12 +45,12 @@ describe('DatabaseController', function () {
4545
done();
4646
});
4747

48-
it('should reject invalid queries', (done) => {
48+
it('should reject invalid queries', done => {
4949
expect(() => validateQuery({ $or: { a: 1 } })).toThrow();
5050
done();
5151
});
5252

53-
it('should accept valid queries', (done) => {
53+
it('should accept valid queries', done => {
5454
expect(() => validateQuery({ $or: [{ a: 1 }, { b: 2 }] })).not.toThrow();
5555
done();
5656
});
@@ -69,7 +69,7 @@ describe('DatabaseController', function () {
6969
'getExpectedType',
7070
]);
7171

72-
it('should not decorate query if no pointer CLPs are present', (done) => {
72+
it('should not decorate query if no pointer CLPs are present', done => {
7373
const clp = buildCLP();
7474
const query = { a: 'b' };
7575

@@ -93,7 +93,7 @@ describe('DatabaseController', function () {
9393
done();
9494
});
9595

96-
it('should decorate query if a pointer CLP entry is present', (done) => {
96+
it('should decorate query if a pointer CLP entry is present', done => {
9797
const clp = buildCLP(['user']);
9898
const query = { a: 'b' };
9999

@@ -120,7 +120,7 @@ describe('DatabaseController', function () {
120120
done();
121121
});
122122

123-
it('should decorate query if an array CLP entry is present', (done) => {
123+
it('should decorate query if an array CLP entry is present', done => {
124124
const clp = buildCLP(['users']);
125125
const query = { a: 'b' };
126126

@@ -150,7 +150,7 @@ describe('DatabaseController', function () {
150150
done();
151151
});
152152

153-
it('should decorate query if an object CLP entry is present', (done) => {
153+
it('should decorate query if an object CLP entry is present', done => {
154154
const clp = buildCLP(['user']);
155155
const query = { a: 'b' };
156156

@@ -180,7 +180,7 @@ describe('DatabaseController', function () {
180180
done();
181181
});
182182

183-
it('should decorate query if a pointer CLP is present and the same field is part of the query', (done) => {
183+
it('should decorate query if a pointer CLP is present and the same field is part of the query', done => {
184184
const clp = buildCLP(['user']);
185185
const query = { a: 'b', user: 'a' };
186186

@@ -209,7 +209,7 @@ describe('DatabaseController', function () {
209209
done();
210210
});
211211

212-
it('should transform the query to an $or query if multiple array/pointer CLPs are present', (done) => {
212+
it('should transform the query to an $or query if multiple array/pointer CLPs are present', done => {
213213
const clp = buildCLP(['user', 'users', 'userObject']);
214214
const query = { a: 'b' };
215215

@@ -248,7 +248,7 @@ describe('DatabaseController', function () {
248248
done();
249249
});
250250

251-
it('should throw an error if for some unexpected reason the property specified in the CLP is neither a pointer nor an array', (done) => {
251+
it('should throw an error if for some unexpected reason the property specified in the CLP is neither a pointer nor an array', done => {
252252
const clp = buildCLP(['user']);
253253
const query = { a: 'b' };
254254

src/Controllers/DatabaseController.js

Lines changed: 47 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1567,7 +1567,7 @@ class DatabaseController {
15671567
objectId: userId,
15681568
};
15691569

1570-
const queries = permFields.map((key) => {
1570+
const queries = permFields.map(key => {
15711571
const fieldDescriptor = schema.getExpectedType(className, key);
15721572
const fieldType =
15731573
fieldDescriptor &&
@@ -1769,9 +1769,12 @@ class DatabaseController {
17691769
const roleClassPromise = this.loadSchema().then(schema =>
17701770
schema.enforceClassExists('_Role')
17711771
);
1772-
const idempotencyClassPromise = this.adapter instanceof MongoStorageAdapter
1773-
? this.loadSchema().then((schema) => schema.enforceClassExists('_Idempotency'))
1774-
: Promise.resolve();
1772+
const idempotencyClassPromise =
1773+
this.adapter instanceof MongoStorageAdapter
1774+
? this.loadSchema().then(schema =>
1775+
schema.enforceClassExists('_Idempotency')
1776+
)
1777+
: Promise.resolve();
17751778

17761779
const usernameUniqueness = userClassPromise
17771780
.then(() =>
@@ -1836,42 +1839,46 @@ class DatabaseController {
18361839
throw error;
18371840
});
18381841

1839-
const idempotencyRequestIdIndex = this.adapter instanceof MongoStorageAdapter
1840-
? idempotencyClassPromise
1841-
.then(() =>
1842-
this.adapter.ensureUniqueness(
1843-
'_Idempotency',
1844-
requiredIdempotencyFields,
1845-
['reqId']
1846-
))
1847-
.catch((error) => {
1848-
logger.warn(
1849-
'Unable to ensure uniqueness for idempotency request ID: ',
1850-
error
1851-
);
1852-
throw error;
1853-
})
1854-
: Promise.resolve();
1855-
1856-
const idempotencyExpireIndex = this.adapter instanceof MongoStorageAdapter
1857-
? idempotencyClassPromise
1858-
.then(() =>
1859-
this.adapter.ensureIndex(
1860-
'_Idempotency',
1861-
requiredIdempotencyFields,
1862-
['expire'],
1863-
'ttl',
1864-
false,
1865-
{ ttl: 0 },
1866-
))
1867-
.catch((error) => {
1868-
logger.warn(
1869-
'Unable to create TTL index for idempotency expire date: ',
1870-
error
1871-
);
1872-
throw error;
1873-
})
1874-
: Promise.resolve();
1842+
const idempotencyRequestIdIndex =
1843+
this.adapter instanceof MongoStorageAdapter
1844+
? idempotencyClassPromise
1845+
.then(() =>
1846+
this.adapter.ensureUniqueness(
1847+
'_Idempotency',
1848+
requiredIdempotencyFields,
1849+
['reqId']
1850+
)
1851+
)
1852+
.catch(error => {
1853+
logger.warn(
1854+
'Unable to ensure uniqueness for idempotency request ID: ',
1855+
error
1856+
);
1857+
throw error;
1858+
})
1859+
: Promise.resolve();
1860+
1861+
const idempotencyExpireIndex =
1862+
this.adapter instanceof MongoStorageAdapter
1863+
? idempotencyClassPromise
1864+
.then(() =>
1865+
this.adapter.ensureIndex(
1866+
'_Idempotency',
1867+
requiredIdempotencyFields,
1868+
['expire'],
1869+
'ttl',
1870+
false,
1871+
{ ttl: 0 }
1872+
)
1873+
)
1874+
.catch(error => {
1875+
logger.warn(
1876+
'Unable to create TTL index for idempotency expire date: ',
1877+
error
1878+
);
1879+
throw error;
1880+
})
1881+
: Promise.resolve();
18751882

18761883
const indexPromise = this.adapter.updateSchemaWithIndexes();
18771884

0 commit comments

Comments
 (0)