parse-community / parse-community/parse-server

_op: delete returning on after save object result

Open
#8,386 13 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type:bug
Dominant language
JavaScript
Stars
21.4k
Forks
4.8k
Avg merge
7h 45m
Merged PRs (30d)
11

Description

New Issue Checklist
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.