parse-server
parse-server copied to clipboard
fix: `Parse.Cloud.startJob` and `Parse.Push.send` not returning status ID when setting Parse Server option `directAccess: true`
Pull Request
- Report security issues confidentially.
- Any contribution is under this license.
- Link this pull request to an issue.
Issue
Calling Parse.Cloud.startJob
or Parse.Push.send
from a Cloud Code function while directAccess is false doesn't return the status Id.
Closes: https://github.com/parse-community/parse-server/issues/8770 Related: https://github.com/parse-community/Parse-SDK-JS/pull/2033
Approach
Support status Id headers in the direct access REST Controller
Tasks
- [x] Add tests
- [x] Add changes to documentation (guides, repository pages, code comments)
- [x] Add security check
- [x] Add new Parse Error codes to Parse JS SDK
Thanks for opening this pull request!
We would have to reuse returnStatus
and that could work but getting response headers from xmlhttprequest
is a nightmare. The code may looks similar but ParseServerRestController returns headers as a json, JS RestController returns headers as a single string that needs to be parsed.
Can this PR be closed thanks to https://github.com/parse-community/Parse-SDK-JS/pull/2033?
We have to wait for https://github.com/parse-community/Parse-SDK-JS/pull/2033 to be released for the test cases here to pass.
I've updated the PR to pass headers in the ParseRestController similarly to the JS RestController. The JS SDK will handle the headers.
That's a great fix; so should be able to merge this in Nov when we'll do a stable release of the JS SDK with that fix included.
Thank you @mtrezza, @dplewis and team for fixing this. Since I can use directAccess: false
as a work around, I am happy to wait for the bug fix in Nov 2023.
https://github.com/parse-community/Parse-SDK-JS/pull/2033 has been merged, but we cannot use the latest Parse JS SDK release in Parse Server due to https://github.com/parse-community/parse-server/issues/8818; so I believe we need fix #8818 first before we can merge this PR here.
@mtrezza Tests have been updated. This is ready to merge.
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 94.16%. Comparing base (
f1469c6
) to head (708d12e
). Report is 6 commits behind head on alpha.
Additional details and impacted files
@@ Coverage Diff @@
## alpha #8766 +/- ##
==========================================
+ Coverage 94.13% 94.16% +0.02%
==========================================
Files 186 186
Lines 14687 14724 +37
==========================================
+ Hits 13826 13865 +39
+ Misses 861 859 -2
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
🎉 This change has been released in version 7.1.0-alpha.6
🎉 This change has been released in version 7.1.0-beta.1
🎉 This change has been released in version 7.1.0