parse-community / parse-community/parse-server
_op: delete returning on after save object result
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 21.4k
- Forks
- 4.8k
- Avg merge
- 7h 45m
- Merged PRs (30d)
- 11
Description
New Issue Checklist
- [ x ] I am not disclosing a vulnerability.
- [ x ] I am not just asking a question.
- [ x ] I have searched through existing issues.
- [ x ] I can reproduce the issue with the latest version of Parse Server.
Issue Description
When we save an object on parse and delete a property, it is returning in the API { __op: 'Delete' }
We manipulate the object on AfterSave and print it before returning, and it doesn't appear these values.
It looks like it is added after the afterSave.
Steps to reproduce
Delete a value on a property field:
if (!helper.isNullOrUndefined(skippedAt) && dirtyKeys.includes("skippedAt")) {
eventOccurrence.set("skippedAt", new Date(skippedAt));
} else {
eventOccurrence.set('skippedAt', { __op: 'Delete' });
}
Actual Outcome
"skippedAt":{"__op":"Delete"},
"rescheduledTo":{"__op":"Delete"},
"deletedAt":{"__op":"Delete"}
Expected Outcome
Don't return these information, because it broke the Model serialization in the apps front end
Environment
Parse server Version 5.4.0 with MongoDB 5
Server
- Parse Server version: 5.40
- Operating system: Linux Ubuntu
- Local or remote host: Google Cloud
Database
- System (MongoDB or Postgres): Mongo
- Database version: 5.0.14
- Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc): MongoDB Atlas
Logs
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the AfterSave lifecycle and the object serialization path for save operations that use the { __op: 'Delete' } marker. Reproduce the reported response with the provided skippedAt example, then verify that deleted fields are absent from the returned API object without changing the AfterSave-visible object.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100