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 versions of Parse Server and the Parse JS SDK.
Issue Description
After pin objects following the steps #1118, i try recovery objects using Parse.Query and fetchFromLocalDatastore() and 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 reproduce
async recovery() {
const qry = new Query(ClassB).fromLocalDatastore()
const objs = await qry.find()
for (const o of objs) {
const obj = await o.fetchFromLocalDatastore()
console.log(obj)
}
}
Actual Outcome
The 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'.
Expected Outcome
The 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.
Environment
Server
- Parse Server version: 5.4.2
- Operating system: Docker Linux Alpine
- Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc): Google Cloud
Database
- System (MongoDB or Postgres): Postgres
- Database version: 13
- Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc): Google Cloud
Client
- Parse JS SDK version: 4.01, 4.1.0, alpha
Logs
ERROR 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