-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Sending unsaved Parse Objects to Client #7004
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
Comments
Thanks for suggesting. A Parse Object can be considered proprietary to the Parse ecosystem. It does not only have the key-value components that you set but also a number of properties and mechanisms in the background. In other words, a Parse Object is a complex container with much more "under the hood", defined for specific usage. If you want to transmit 3rd party data or any other data that is not a Parse Object by definition, why don't you define a custom container and parse it in the app? |
Thank you for your lightning fast answer. But it's probably much more effort to implement something like this in the server and sdks than parsing the handful custom structures directly in the app. |
It's not so much the effort but the viability of such a change. If we can demonstrate a use case and the value / viability of such a change, we can go to the next step and determine its feasibility. |
In the first message you said that you got |
I get the error on the Server before sending (an unsaved) ParseObject via cloud code. That codesnippet should explain the situation.
before the Server sends the Object it tries to call
|
In principle I don't see an issue with composing a Parse Object in Cloud Code, sending it to a client, continue composing it there and saving it from the client side. Seems like a simple use case. The question is what background mechanism require a Parse Object to be saved before being sent between server and client. As a workaround, did you try to set a dummy object ID? |
Setting a dummy That function is called in the Parse-JS-SDK to get the id when an Object with an objectId =
|
I agree, without having looked into any further implications of sending an object without ID. Maybe the blame line can give you further hints as to why there is this check of ID being set. In any case, feel free to do some further investigation and if nothing speaks against it, create a PR to remove this ID check. The PR should include test cases for handling objects without ID. |
If you return the JSON, it should work. Give a try with: Parse.Cloud.define("notworkingfunction", async (request) => {
const data = await getSomeDataFromThirdParty();
const notSavedObject = new Parse.Object("NotExistingClass");
notSavedObject.set(data);
return notSavedObject._toFullJSON();
}); |
I didn't get the test environment up and running... |
Have you run |
@davimacedo thank you, but yes I did. It's possibly the way the Docker-Container is build. |
Is your feature request related to a problem? Please describe.
I use Parse Server as App-Backend and store some informations in the Parse DB. Other informations are received live from third party backends via cloud-code. To unify the communication between the Parse Backend and the App I tried to generate temporary Parse Objects to send these Objects to the App but I aren't allowed to store them in the Parse DB. When I try to send the object to the App I got the error "Cannot create a pointer to an unsaved ParseObject"
Describe the solution you'd like
Send the Objects to the App (perhaps with a "temp_xyz" objectId like the local objectId)
The text was updated successfully, but these errors were encountered: