Skip to content

Commit

Permalink
Merge branch 'master' into enable-direct-access-by-default
Browse files Browse the repository at this point in the history
  • Loading branch information
mtrezza committed Apr 4, 2021
2 parents 40ff567 + 70e1347 commit 723263c
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"presets": [
["@babel/preset-env", {
"targets": {
"node": "8"
"node": "12"
}
}]
],
Expand Down
11 changes: 3 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
- '**'
env:
COVERAGE_OPTION: ./node_modules/.bin/nyc
NODE_VERSION: 10
NODE_VERSION: 14.16.0
PARSE_SERVER_TEST_TIMEOUT: 20000
jobs:
check-ci:
Expand Down Expand Up @@ -82,21 +82,16 @@ jobs:
MONGODB_TOPOLOGY: standalone
MONGODB_STORAGE_ENGINE: wiredTiger
NODE_VERSION: 14.16.0
- name: Node 10
MONGODB_VERSION: 4.4.4
MONGODB_TOPOLOGY: standalone
MONGODB_STORAGE_ENGINE: wiredTiger
NODE_VERSION: 10.24.0
- name: Node 12
MONGODB_VERSION: 4.4.4
MONGODB_TOPOLOGY: standalone
MONGODB_STORAGE_ENGINE: wiredTiger
NODE_VERSION: 12.21.0
NODE_VERSION: 12.22.0
- name: Node 15
MONGODB_VERSION: 4.4.4
MONGODB_TOPOLOGY: standalone
MONGODB_STORAGE_ENGINE: wiredTiger
NODE_VERSION: 15.12.0
NODE_VERSION: 15.13.0
fail-fast: false
name: ${{ matrix.name }}
timeout-minutes: 15
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ ___
- Added Parse Server Security Check to report weak security settings (Manuel Trezza, dblythy) [#7247](https://github.com/parse-community/parse-server/issues/7247)
- 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)
- 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)
- 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)
### Other Changes
- 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)
- request.context for afterFind triggers (dblythy) [#7078](https://github.com/parse-community/parse-server/pull/7078)
Expand All @@ -120,6 +121,8 @@ ___
- Improve data consistency in Push and Job Status update (Diamond Lewis) [#7267](https://github.com/parse-community/parse-server/pull/7267)
- Excluding keys that have trailing edges.node when performing GraphQL resolver (Chris Bland) [#7273](https://github.com/parse-community/parse-server/pull/7273)
- Added centralized feature deprecation with standardized warning logs (Manuel Trezza) [#7303](https://github.com/parse-community/parse-server/pull/7303)
- Use Node.js 15.13.0 in CI (Olle Jonsson) [#7312](https://github.com/parse-community/parse-server/pull/7312)
- 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)
___
## 4.5.0
[Full Changelog](https://github.com/parse-community/parse-server/compare/4.4.0...4.5.0)
Expand Down
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<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>
<a href="https://community.parseplatform.org/"><img alt="Join the conversation" src="https://img.shields.io/discourse/https/community.parseplatform.org/topics.svg"></a>
<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>
<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>
<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>
<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>
<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>
</p>
Expand Down Expand Up @@ -113,10 +113,9 @@ Parse Server is continuously tested with the most recent releases of Node.js to

| Version | Latest Patch Version | End-of-Life Date | Compatibility |
|------------|----------------------|------------------|--------------------|
| Node.js 10 | 10.24.0 | April 2021 | ✅ Fully compatible |
| Node.js 12 | 12.21.0 | April 2022 | ✅ Fully compatible |
| Node.js 12 | 12.22.0 | April 2022 | ✅ Fully compatible |
| Node.js 14 | 14.16.0 | April 2023 | ✅ Fully compatible |
| Node.js 15 | 15.12.0 | June 2021 | ✅ Fully compatible |
| Node.js 15 | 15.13.0 | June 2021 | ✅ Fully compatible |

#### MongoDB
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.
Expand Down
3 changes: 1 addition & 2 deletions resources/ci/ciCheck.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ async function checkNodeVersions() {
releasedVersions,
latestComponent: CiVersionCheck.versionComponents.minor,
ignoreReleasedVersions: [
'<10.0.0', // These versions have reached their end-of-life support date
'>=11.0.0 <12.0.0', // These versions have reached their end-of-life support date
'<12.0.0', // These versions have reached their end-of-life support date
'>=13.0.0 <14.0.0', // These versions have reached their end-of-life support date
'>=16.0.0', // This version has not been officially released yet
],
Expand Down
29 changes: 29 additions & 0 deletions spec/ParseFile.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

'use strict';

const { FilesController } = require('../lib/Controllers/FilesController');
const request = require('../lib/request');

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

it('saves the file with tags', async () => {
spyOn(FilesController.prototype, 'createFile').and.callThrough();
const file = new Parse.File('hello.txt', data, 'text/plain');
const tags = { hello: 'world' };
file.setTags(tags);
expect(file.url()).toBeUndefined();
const result = await file.save();
expect(file.name()).toBeDefined();
expect(file.url()).toBeDefined();
expect(result.tags()).toEqual(tags);
expect(FilesController.prototype.createFile.calls.argsFor(0)[4]).toEqual({
tags: tags,
metadata: {},
});
});

it('does not pass empty file tags while saving', async () => {
spyOn(FilesController.prototype, 'createFile').and.callThrough();
const file = new Parse.File('hello.txt', data, 'text/plain');
expect(file.url()).toBeUndefined();
expect(file.name()).toBeDefined();
await file.save();
expect(file.url()).toBeDefined();
expect(FilesController.prototype.createFile.calls.argsFor(0)[4]).toEqual({
metadata: {},
});
});

it('save file in object', async done => {
const file = new Parse.File('hello.txt', data, 'text/plain');
ok(!file.url());
Expand Down
14 changes: 10 additions & 4 deletions src/Routers/FilesRouter.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,16 +166,22 @@ export class FilesRouter {
// update fileSize
const bufferData = Buffer.from(fileObject.file._data, 'base64');
fileObject.fileSize = Buffer.byteLength(bufferData);
// prepare file options
const fileOptions = {
metadata: fileObject.file._metadata,
};
// some s3-compatible providers (DigitalOcean, Linode) do not accept tags
// so we do not include the tags option if it is empty.
const fileTags =
Object.keys(fileObject.file._tags).length > 0 ? { tags: fileObject.file._tags } : {};
Object.assign(fileOptions, fileTags);
// save file
const createFileResult = await filesController.createFile(
config,
fileObject.file._name,
bufferData,
fileObject.file._source.type,
{
tags: fileObject.file._tags,
metadata: fileObject.file._metadata,
}
fileOptions
);
// update file with new data
fileObject.file._name = createFileResult.name;
Expand Down

0 comments on commit 723263c

Please sign in to comment.