Skip to content

ParseObject still has deleteOperation in field after saveCallback, when using beforeSave in Cloud #1840

Closed
@pargu

Description

@pargu

Reproduce:

  1. Set remove / removeKey on a field on a ParseObject and save object with block (using beforeSave on Cloud for object - only returning response.success())
  2. Logging object after save has been done in block still contains deleteOperation for the field. On server side all is fine, with the right values set (value removed).
  3. Later on trying to save new value to same field causing "Operation is invalid after previous operation", because you are trying to add to a field that has a deleteOperation still in it and trying to save said object.

Hacks

  1. Add empty string to field instead of remove / removeKey (null checks can't be made later on)
  2. Create a new ParseObject and init old object into it, before saving the second time (Everything goes fine, cache:ing is lost if you need to update something in views in previous screens which are connected to original object. This hack does not support ParseInstallation and ParseUser)
  3. Fetch object again in saveCallback (Not very efficient)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions