-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
Creating an object with properties that are new objects which consist of the exact same properties as other new objects causes schema error #151
Comments
To be honest I'm not sure if it's a Parse-Swift problem or something deeper with Swift itself. But I figure the way it acts that it's something with how Pointer interacts with saving. |
If you run into situations like this, you should save the objects Test1, Test2, and Test3 separately and first before adding them to TestObject. I imagine the problem is the items are currently unsaved and look exactly the same when they are encoded, so the SDK is having trouble differentiating them. As soon as they are saved and obtain an objectId, the SDK can differentiate them. You also shouldn’t run into this problem if you are using custom objectIds |
Ah i see. Gotcha. So this isn't a bug or something we can add as. Feature request? Thanks! |
I’m not sure if it will get addressed as saving like this is something that shouldn’t occur and is more of a developer error. If Test1, 2, or 3, are going to have zero properties set initially, just leave them as nil on TestObject, update the respective properties when you really have something to save. Or, if you are going to create multiple ParseObjects that have the same properties/fields, just represent them as 1 ParseObject and take advantage of “querying”. In your examples it seems you are trying to set ACL’s. You can do that with CLP’s or by using Cloud Code when those objects are created. |
I initially encountered this problem when I ran a check on login to make sure my User object has all the Pointers it needed. if not, it creates those objects and adds it in. They're all blank objects to start with but those objects of course can be edited by the user once they login. so I needed them "blank". All good though. Saving before hand worked well. |
New Issue Checklist
Issue Description
saving an object with pointers and pointers point to objects with the same struct causes schema error when saving.
caught error: "ParseError code=111 error=schema mismatch for TestObject.test1; expected Pointer<Test1> but got Pointer<Test3>"
Parse-Swift in the middle of saving the pointers gets confused as to what the object is.
Steps to reproduce
Given something like so:
running testSaving() will cause the schema error.
Even if there's only 2 that are the same - will cause an error.
However, adding extra arguments to differentiate each object clearly like so:
will save the testObject successfully.
Actual Outcome
schema error
caught error: "ParseError code=111 error=schema mismatch for TestObject.test1; expected Pointer<Test1> but got Pointer<Test3>"
Expected Outcome
object should still save successfully.
Environment
Client
5.8.3
15.2
MacOS
17.1.1
Server
6.4
MacOS
local
Database
mongodb
6
local
Logs
The text was updated successfully, but these errors were encountered: