Description
New Issue Checklist
- I am not disclosing a vulnerability.
- I am not just asking a question.
- I have searched through existing issues.
- I can reproduce the issue with the latest version of Parse Server.
Issue Description
I called Parse.Cloud.startJob in a cloud function. I expect Parse.Cloud.startJob to return jobStatusId but I received an empty dictionary. This is the specification of Parse.Cloud.startJob, http://parseplatform.org/Parse-SDK-JS/api/4.0.1/Parse.Cloud.html#.startJob
This issue only occur after I upgrade parse-server from 5.4.0 -> 6.3.0
Is this a bug or change in Parse.Cloud.startJob behaviour?
Steps to reproduce
Define a job and start the job in a cloud function. Since I am building iOS App, I call the startTestJob
using Parse-SDK-iOS-OSX library.
Parse.Cloud.define("startTestJob", async (request) => {
var jobId = await Parse.Cloud.startJob('testJob', request.params);
return jobId;
});
Parse.Cloud.job("testJob", async (request) => {
return "testJob Done";
});
iOS Code
PFCloud.callFunction(inBackground: "startTestJob", withParameters:[:]) {
(result: Any?, error: Error?) -> Void in
...
}
Actual Outcome
The result
is empty dictionary.
info: Ran cloud function startTestJob for user XYZ with:
Input: {}
Result: {} {"functionName":"startTestJob","params":{},"user":"YVNLpZY6k6"}
verbose: RESPONSE from [POST] /parse/functions/startTestJob: {
"response": {
"result": {}
}
} {"result":{"response":{"result":{}}}}
Expected Outcome
I expect the result
to contain the jobStatusID.
FYI, I tried another way to start the job. Starting the job from the parse dashboard website, I see the jobStatusId in the server verbose log.
verbose: REQUEST for [POST] /parse/jobs: {
"description": "Executing from job schedule web console.",
"input": {},
"jobName": "testJob",
"when": 0
} {"body":{"description":"Executing from job schedule web console.","input":{},"jobName":"testJob","when":0},"headers":{"accept":"*/*","accept-encoding":"gzip, deflate","accept-language":"en-SG,en-GB;q=0.9,en;q=0.8","connection":"keep-alive","content-length":"298","content-type":"text/plain","host":"localhost:1337","origin":"http://localhost:4040","referer":"http://localhost:4040/","sec-fetch-dest":"empty","sec-fetch-mode":"cors","sec-fetch-site":"same-site","user-agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Safari/605.1.15"},"method":"POST","url":"/parse/jobs"}
verbose: RESPONSE from [POST] /parse/jobs: {
"headers": {
"X-Parse-Job-Status-Id": "47QXAcrSaN"
},
"response": {}
} {"result":{"headers":{"X-Parse-Job-Status-Id":"47QXAcrSaN"},"response":{}}}
Environment
Server
- Parse Server version:
6.3.0
- Operating system:
MacOS Ventura 13.5.1
- Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc):
Local
Database
- System (MongoDB or Postgres):
Mongo
- Database version:
6.0.4
- Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc):
Local
Client
- SDK (iOS, Android, JavaScript, PHP, Unity, etc):
Parse-SDK-iOS-OSX
- SDK version:
2.7.0