-
-
Notifications
You must be signed in to change notification settings - Fork 596
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
Allow Pin of unsaved Parse.Object with an unsaved, but pinned, Parse.Object pointer #1118
Comments
Closes: #1118 Let me know if more tests are needed
* fix(LocalDatastore): Allow Pin of unsaved Parse.Object Closes: #1118 Let me know if more tests are needed * Generate localId for subclasses * Improve coverage
Issue DescriptionAfter the ‘pin’ of the unsaved Parse.Object using fetchFromLocalDatastore() we get the error 'Error: Cannot create a pointer to an unsaved ParseObject'. If you refresh the browser and do the same you'll get the error 'Error:Uncaught (in promise): TypeError: object._getId is not a function'. Steps to reproduceFolowing @BenApes steps do the next step:
Expected ResultsThe recovered object instance of ClassB should be retrieved with all of the saved attributes and it's pointer to ClassA points to the local instance of ClassA. Actual OutcomeThe instance of ClassB cannot be retrieved with all of it's attributes using the fetchFromLocalDataStore() with the error 'Cannot create a pointer to an unsaved ParseObject'. If you refresh the browser and do the same you'll get the error 'Uncaught (in promise): TypeError: object._getId is not a function'. Environment Setup- Server
- JS SDK
Logs/TraceERROR Error:Uncaught (in promise): TypeError: object._getId is not a function ERROR Error: "Uncaught (in promise): Error: Cannot create a pointer to an unsaved ParseObject |
I believe that the inclusion of the object._localId option in the function getKeyForObject of the LocalDataStore class
|
@jcarloshorus @GabrielPR I believe this issue has been resolved in #1662 Please update to the latest alpha release to try it. If there is still a problem, please open a new issue so that we may track it. |
Issue Description
When using my Parse JS SDK powered application offline, I can create a Parse Object and 'pin' it, allowing me to get the object from the local datastore when I want it, and save it later when I have connection. I cannot, however, create another object of a different class, assign the first object to a property of the second object and then pin the second object into the local datastore, as it results in the 'Cannot create a pointer to an unsaved ParseObject' error.
Steps to reproduce
Expected Results
The instance of ClassB 'testClassB' pins to the local datastore without issue, and it's pointer to ClassA points to the local, unsaved, instance of ClassA.
Actual Outcome
The instance of ClassB does not pin to the local datastore, with the error 'Cannot create a pointer to an unsaved ParseObject'.
Environment Setup
Server
JS SDK
Logs/Trace
The text was updated successfully, but these errors were encountered: