Skip to content

Commit 723263c

Browse files
committed
Merge branch 'master' into enable-direct-access-by-default
2 parents 40ff567 + 70e1347 commit 723263c

File tree

7 files changed

+50
-19
lines changed

7 files changed

+50
-19
lines changed

Diff for: .babelrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"presets": [
77
["@babel/preset-env", {
88
"targets": {
9-
"node": "8"
9+
"node": "12"
1010
}
1111
}]
1212
],

Diff for: .github/workflows/ci.yml

+3-8
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
- '**'
99
env:
1010
COVERAGE_OPTION: ./node_modules/.bin/nyc
11-
NODE_VERSION: 10
11+
NODE_VERSION: 14.16.0
1212
PARSE_SERVER_TEST_TIMEOUT: 20000
1313
jobs:
1414
check-ci:
@@ -82,21 +82,16 @@ jobs:
8282
MONGODB_TOPOLOGY: standalone
8383
MONGODB_STORAGE_ENGINE: wiredTiger
8484
NODE_VERSION: 14.16.0
85-
- name: Node 10
86-
MONGODB_VERSION: 4.4.4
87-
MONGODB_TOPOLOGY: standalone
88-
MONGODB_STORAGE_ENGINE: wiredTiger
89-
NODE_VERSION: 10.24.0
9085
- name: Node 12
9186
MONGODB_VERSION: 4.4.4
9287
MONGODB_TOPOLOGY: standalone
9388
MONGODB_STORAGE_ENGINE: wiredTiger
94-
NODE_VERSION: 12.21.0
89+
NODE_VERSION: 12.22.0
9590
- name: Node 15
9691
MONGODB_VERSION: 4.4.4
9792
MONGODB_TOPOLOGY: standalone
9893
MONGODB_STORAGE_ENGINE: wiredTiger
99-
NODE_VERSION: 15.12.0
94+
NODE_VERSION: 15.13.0
10095
fail-fast: false
10196
name: ${{ matrix.name }}
10297
timeout-minutes: 15

Diff for: CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ ___
9595
- Added Parse Server Security Check to report weak security settings (Manuel Trezza, dblythy) [#7247](https://github.com/parse-community/parse-server/issues/7247)
9696
- EXPERIMENTAL: Added new page router with placeholder rendering and localization of custom and feature pages such as password reset and email verification (Manuel Trezza) [#6891](https://github.com/parse-community/parse-server/issues/6891)
9797
- EXPERIMENTAL: Added custom routes to easily customize flows for password reset, email verification or build entirely new flows (Manuel Trezza) [#7231](https://github.com/parse-community/parse-server/issues/7231)
98+
- Remove support for Node 10 which has reached its End-of-Life support date (Manuel Trezza) [#7314](https://github.com/parse-community/parse-server/pull/7314)
9899
### Other Changes
99100
- Fix error when a not yet inserted job is updated (Antonio Davi Macedo Coelho de Castro) [#7196](https://github.com/parse-community/parse-server/pull/7196)
100101
- request.context for afterFind triggers (dblythy) [#7078](https://github.com/parse-community/parse-server/pull/7078)
@@ -120,6 +121,8 @@ ___
120121
- Improve data consistency in Push and Job Status update (Diamond Lewis) [#7267](https://github.com/parse-community/parse-server/pull/7267)
121122
- Excluding keys that have trailing edges.node when performing GraphQL resolver (Chris Bland) [#7273](https://github.com/parse-community/parse-server/pull/7273)
122123
- Added centralized feature deprecation with standardized warning logs (Manuel Trezza) [#7303](https://github.com/parse-community/parse-server/pull/7303)
124+
- Use Node.js 15.13.0 in CI (Olle Jonsson) [#7312](https://github.com/parse-community/parse-server/pull/7312)
125+
- Fix file upload issue for S3 compatible storage (Linode, DigitalOcean) by avoiding empty tags property when creating a file (Ali Oguzhan Yildiz) [#7300](https://github.com/parse-community/parse-server/pull/7300)
123126
___
124127
## 4.5.0
125128
[Full Changelog](https://github.com/parse-community/parse-server/compare/4.4.0...4.5.0)

Diff for: README.md

+3-4
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<a href="https://www.npmjs.com/package/parse-server"><img alt="npm version" src="https://img.shields.io/npm/v/parse-server.svg?style=flat"></a>
1818
<a href="https://community.parseplatform.org/"><img alt="Join the conversation" src="https://img.shields.io/discourse/https/community.parseplatform.org/topics.svg"></a>
1919
<a href="https://snyk.io/test/github/parse-community/parse-server"><img alt="Snyk badge" src="https://snyk.io/test/github/parse-community/parse-server/badge.svg"></a>
20-
<a href="https://nodejs.org/"><img alt="Node.js 10,12,14,15" src="https://img.shields.io/badge/nodejs-10,_12,_14,_15-green.svg?logo=node.js&style=flat"></a>
20+
<a href="https://nodejs.org/"><img alt="Node.js 12,14,15" src="https://img.shields.io/badge/nodejs-12,_14,_15-green.svg?logo=node.js&style=flat"></a>
2121
<a href="https://www.mongodb.com/"><img alt="MongoDB 3.6,4.0,4.2,4.4" src="https://img.shields.io/badge/mongodb-3.6,_4.0,_4.2,_4.4-green.svg?logo=mongodb&style=flat"></a>
2222
<a href="https://www.postgresql.org"> <img alt="PostgreSQL 10,11,12,13" src="https://img.shields.io/badge/postgresql-10,_11,_12,_13-green.svg?logo=postgresql&style=flat"></a>
2323
</p>
@@ -113,10 +113,9 @@ Parse Server is continuously tested with the most recent releases of Node.js to
113113

114114
| Version | Latest Patch Version | End-of-Life Date | Compatibility |
115115
|------------|----------------------|------------------|--------------------|
116-
| Node.js 10 | 10.24.0 | April 2021 | ✅ Fully compatible |
117-
| Node.js 12 | 12.21.0 | April 2022 | ✅ Fully compatible |
116+
| Node.js 12 | 12.22.0 | April 2022 | ✅ Fully compatible |
118117
| Node.js 14 | 14.16.0 | April 2023 | ✅ Fully compatible |
119-
| Node.js 15 | 15.12.0 | June 2021 | ✅ Fully compatible |
118+
| Node.js 15 | 15.13.0 | June 2021 | ✅ Fully compatible |
120119

121120
#### MongoDB
122121
Parse Server is continuously tested with the most recent releases of MongoDB to ensure compatibility. We follow the [MongoDB support schedule](https://www.mongodb.com/support-policy) and only test against versions that are officially supported and have not reached their end-of-life date.

Diff for: resources/ci/ciCheck.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@ async function checkNodeVersions() {
5959
releasedVersions,
6060
latestComponent: CiVersionCheck.versionComponents.minor,
6161
ignoreReleasedVersions: [
62-
'<10.0.0', // These versions have reached their end-of-life support date
63-
'>=11.0.0 <12.0.0', // These versions have reached their end-of-life support date
62+
'<12.0.0', // These versions have reached their end-of-life support date
6463
'>=13.0.0 <14.0.0', // These versions have reached their end-of-life support date
6564
'>=16.0.0', // This version has not been officially released yet
6665
],

Diff for: spec/ParseFile.spec.js

+29
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
'use strict';
55

6+
const { FilesController } = require('../lib/Controllers/FilesController');
67
const request = require('../lib/request');
78

89
const str = 'Hello World!';
@@ -205,6 +206,34 @@ describe('Parse.File testing', () => {
205206
notEqual(file.name(), 'hello.txt');
206207
});
207208

209+
it('saves the file with tags', async () => {
210+
spyOn(FilesController.prototype, 'createFile').and.callThrough();
211+
const file = new Parse.File('hello.txt', data, 'text/plain');
212+
const tags = { hello: 'world' };
213+
file.setTags(tags);
214+
expect(file.url()).toBeUndefined();
215+
const result = await file.save();
216+
expect(file.name()).toBeDefined();
217+
expect(file.url()).toBeDefined();
218+
expect(result.tags()).toEqual(tags);
219+
expect(FilesController.prototype.createFile.calls.argsFor(0)[4]).toEqual({
220+
tags: tags,
221+
metadata: {},
222+
});
223+
});
224+
225+
it('does not pass empty file tags while saving', async () => {
226+
spyOn(FilesController.prototype, 'createFile').and.callThrough();
227+
const file = new Parse.File('hello.txt', data, 'text/plain');
228+
expect(file.url()).toBeUndefined();
229+
expect(file.name()).toBeDefined();
230+
await file.save();
231+
expect(file.url()).toBeDefined();
232+
expect(FilesController.prototype.createFile.calls.argsFor(0)[4]).toEqual({
233+
metadata: {},
234+
});
235+
});
236+
208237
it('save file in object', async done => {
209238
const file = new Parse.File('hello.txt', data, 'text/plain');
210239
ok(!file.url());

Diff for: src/Routers/FilesRouter.js

+10-4
Original file line numberDiff line numberDiff line change
@@ -166,16 +166,22 @@ export class FilesRouter {
166166
// update fileSize
167167
const bufferData = Buffer.from(fileObject.file._data, 'base64');
168168
fileObject.fileSize = Buffer.byteLength(bufferData);
169+
// prepare file options
170+
const fileOptions = {
171+
metadata: fileObject.file._metadata,
172+
};
173+
// some s3-compatible providers (DigitalOcean, Linode) do not accept tags
174+
// so we do not include the tags option if it is empty.
175+
const fileTags =
176+
Object.keys(fileObject.file._tags).length > 0 ? { tags: fileObject.file._tags } : {};
177+
Object.assign(fileOptions, fileTags);
169178
// save file
170179
const createFileResult = await filesController.createFile(
171180
config,
172181
fileObject.file._name,
173182
bufferData,
174183
fileObject.file._source.type,
175-
{
176-
tags: fileObject.file._tags,
177-
metadata: fileObject.file._metadata,
178-
}
184+
fileOptions
179185
);
180186
// update file with new data
181187
fileObject.file._name = createFileResult.name;

0 commit comments

Comments
 (0)