-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cloud code doesn't automatically parse File objects #2294
Comments
That seems to be valid, do you want to try to fix it? |
Ha, didn't see that coming. I haven't actually compiled the source myself. EDIT: Even still, I don't know the correct procedure for converting a JSON structure in a Parse.File. Is that documented somewhere? |
@smassin this is a community project :) We already have a parse for Dates, https://github.com/ParsePlatform/parse-server/blob/master/src/Routers/FunctionsRouter.js#L63 Need to add a new Parser for files. |
I can give it a go, that seems pretty straight forward |
Thanks I appreciate it. |
Confirmed working. Thanks a lot @flovilmart 👍 |
…ons (parse-community#2297) * fix for parse-community#2294 * fail tests * Makes sure dates are compatible with Parse.com CloudCode parse-community#2214 * Adds regression tests for parse-community#2204
…ons (parse-community#2297) * fix for parse-community#2294 * fail tests * Makes sure dates are compatible with Parse.com CloudCode parse-community#2214 * Adds regression tests for parse-community#2204
Issue Description
When uploading a ParseFile as a parameter to cloud code it does not automatically parse the object and transform it into the ParseFile on the cloud code side. On parse.com it would do this automatically. Essentially I could save a file on the client and then pass the ParseFile as a parameter in a cloud call and then on the cloud side it would show up as a ParseFile. Documented here: https://parse.com/docs/rest/guide#objects-data-types . Instead the cloud side just sees a normal JSON object that would represent a ParseFile. Even using the Parse Client JS SDK has the same problem.
To further muck up the situation, parse-server allows these JSON objects to be saved in File columns but when they are retrieved they are still a basic JSON object and calling .url() causes the server to spin forever and never complete the request.
Steps to reproduce
Expected Results
request.params.file instanceof Parse.File === true;
Actual Outcome
request.params.file instanceof Parse.File === false;
Environment Setup
N/A -- Completely parse-server software issue
Logs/Trace
Outcomes above should be detailed enough.
The text was updated successfully, but these errors were encountered: