Closed
Description
- You've met the prerequisites.
- You're running the latest version of Parse Server.
- You've searched through existing issues. Chances are that your issue has been reported or resolved before.
Environment Setup
nodejs: 4.4.0
parse-server: 2.2.2
Description of the issue
When the beforeSave trigger for an object is present, the save call overwrites the pointer fields with only the object id even thou' the pointer field had fetched object before calling save.
Steps to reproduce
new Parse.Query('Person')
.first()
.then(person => {
console.log(person.createdAt, person.get('name')); // prints correctly
const account = new Parse.Object('Account', {person});
console.log(account.get('person').createdAt, account.get('person').get('name')); // prints correctly
return account.save();
})
.then(account => {
// prints correctly only if there are no beforeSave triggers.
console.log(account.get('person').createdAt, account.get('person').get('name'));
});
For the above, I would ideally expect the console.log to print both person's createdAt and name in all the three logs. But the last console.log prints the values correctly only if beforeSave trigger is not present. If beforeSave trigger present, then it just contains the pointer value and loses the object data.