From 6364948d814bc4147504d986afd68c400aca63ce Mon Sep 17 00:00:00 2001 From: Manuel <5673677+mtrezza@users.noreply.github.com> Date: Sun, 14 Apr 2024 01:47:27 +0200 Subject: [PATCH 1/3] ci: Fix codecov upload (#9082) --- .github/workflows/ci.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 00bb771d..3b8d64a6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -210,7 +210,11 @@ jobs: - run: npm run coverage env: CI: true - - run: bash <(curl -s https://codecov.io/bash) + - name: Upload code coverage + uses: codecov/codecov-action@v4 + with: + fail_ci_if_error: true + token: ${{ secrets.CODECOV_TOKEN }} check-postgres: strategy: matrix: @@ -281,7 +285,11 @@ jobs: - run: npm run coverage env: CI: true - - run: bash <(curl -s https://codecov.io/bash) + - name: Upload code coverage + uses: codecov/codecov-action@v4 + with: + fail_ci_if_error: true + token: ${{ secrets.CODECOV_TOKEN }} concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true From 5b0efb22efe94c47f243cf8b1e6407ed5c5a67d3 Mon Sep 17 00:00:00 2001 From: Diamond Lewis Date: Sun, 14 Apr 2024 14:42:20 -0500 Subject: [PATCH 2/3] fix: `Parse.Cloud.startJob` and `Parse.Push.send` not returning status ID when setting Parse Server option `directAccess: true` (#8766) --- spec/ParseServerRESTController.spec.js | 54 ++++++++++++++++++++++++++ src/ParseServerRESTController.js | 8 ++-- 2 files changed, 59 insertions(+), 3 deletions(-) diff --git a/spec/ParseServerRESTController.spec.js b/spec/ParseServerRESTController.spec.js index 5e6a550e..f4b75398 100644 --- a/spec/ParseServerRESTController.spec.js +++ b/spec/ParseServerRESTController.spec.js @@ -631,4 +631,58 @@ describe('ParseServerRESTController', () => { expect(sessions[0].get('installationId')).toBe(installationId); expect(sessions[0].get('sessionToken')).toBe(loggedUser.sessionToken); }); + + it('returns a statusId when running jobs', async () => { + Parse.Cloud.job('CloudJob', () => { + return 'Cloud job completed'; + }); + const res = await RESTController.request( + 'POST', + '/jobs/CloudJob', + {}, + { useMasterKey: true, returnStatus: true } + ); + const jobStatusId = res._headers['X-Parse-Job-Status-Id']; + expect(jobStatusId).toBeDefined(); + const result = await Parse.Cloud.getJobStatus(jobStatusId); + expect(result.id).toBe(jobStatusId); + }); + + it('returns a statusId when running push notifications', async () => { + const payload = { + data: { alert: 'We return status!' }, + where: { deviceType: 'ios' }, + }; + const res = await RESTController.request('POST', '/push', payload, { + useMasterKey: true, + returnStatus: true, + }); + const pushStatusId = res._headers['X-Parse-Push-Status-Id']; + expect(pushStatusId).toBeDefined(); + + const result = await Parse.Push.getPushStatus(pushStatusId); + expect(result.id).toBe(pushStatusId); + }); + + it('returns a statusId when running batch push notifications', async () => { + const payload = { + data: { alert: 'We return status!' }, + where: { deviceType: 'ios' }, + }; + const res = await RESTController.request('POST', 'batch', { + requests: [{ + method: 'POST', + path: '/push', + body: payload, + }], + }, { + useMasterKey: true, + returnStatus: true, + }); + const pushStatusId = res[0]._headers['X-Parse-Push-Status-Id']; + expect(pushStatusId).toBeDefined(); + + const result = await Parse.Push.getPushStatus(pushStatusId); + expect(result.id).toBe(pushStatusId); + }); }); diff --git a/src/ParseServerRESTController.js b/src/ParseServerRESTController.js index 12ee0a67..ed6145a9 100644 --- a/src/ParseServerRESTController.js +++ b/src/ParseServerRESTController.js @@ -58,8 +58,10 @@ function ParseServerRESTController(applicationId, router) { response => { if (options.returnStatus) { const status = response._status; + const headers = response._headers; delete response._status; - return { success: response, _status: status }; + delete response._headers; + return { success: response, _status: status, _headers: headers }; } return { success: response }; }, @@ -128,9 +130,9 @@ function ParseServerRESTController(applicationId, router) { }) .then( resp => { - const { response, status } = resp; + const { response, status, headers = {} } = resp; if (options.returnStatus) { - resolve({ ...response, _status: status }); + resolve({ ...response, _status: status, _headers: headers }); } else { resolve(response); } From 242002432fa305aa1c68b07679582164f560bda8 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Sun, 14 Apr 2024 19:43:15 +0000 Subject: [PATCH 3/3] chore(release): 7.1.0-alpha.6 [skip ci] # [7.1.0-alpha.6](https://github.com/parse-community/parse-server/compare/7.1.0-alpha.5...7.1.0-alpha.6) (2024-04-14) ### Bug Fixes * `Parse.Cloud.startJob` and `Parse.Push.send` not returning status ID when setting Parse Server option `directAccess: true` ([#8766](https://github.com/parse-community/parse-server/issues/8766)) ([5b0efb2](https://github.com/parse-community/parse-server/commit/5b0efb22efe94c47f243cf8b1e6407ed5c5a67d3)) --- changelogs/CHANGELOG_alpha.md | 7 +++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/changelogs/CHANGELOG_alpha.md b/changelogs/CHANGELOG_alpha.md index 9f5cc88d..562543e4 100644 --- a/changelogs/CHANGELOG_alpha.md +++ b/changelogs/CHANGELOG_alpha.md @@ -1,3 +1,10 @@ +# [7.1.0-alpha.6](https://github.com/parse-community/parse-server/compare/7.1.0-alpha.5...7.1.0-alpha.6) (2024-04-14) + + +### Bug Fixes + +* `Parse.Cloud.startJob` and `Parse.Push.send` not returning status ID when setting Parse Server option `directAccess: true` ([#8766](https://github.com/parse-community/parse-server/issues/8766)) ([5b0efb2](https://github.com/parse-community/parse-server/commit/5b0efb22efe94c47f243cf8b1e6407ed5c5a67d3)) + # [7.1.0-alpha.5](https://github.com/parse-community/parse-server/compare/7.1.0-alpha.4...7.1.0-alpha.5) (2024-04-07) diff --git a/package-lock.json b/package-lock.json index 4d78e3e3..826a2dbd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "parse-server", - "version": "7.1.0-alpha.5", + "version": "7.1.0-alpha.6", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "parse-server", - "version": "7.1.0-alpha.5", + "version": "7.1.0-alpha.6", "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { diff --git a/package.json b/package.json index e6f8fa72..ff00ffdd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "parse-server", - "version": "7.1.0-alpha.5", + "version": "7.1.0-alpha.6", "description": "An express module providing a Parse-compatible API server", "main": "lib/index.js", "repository": {