Skip to content

Parse.Object.set sliently handles validation errors #2104

Closed
@dplewis

Description

@dplewis

New Issue Checklist

Issue Description

You can pass an option in set to handle validation errors. The problem is this option isn't well documented and isn't widely used. This method of error handling is called backbone and was removed in 2.0.0.

Removing this in favor of an thrown error is a breaking change as a lot of code uses .set. The main errors are for invalid key names and invalid ACL.

Ref: #2097

Steps to reproduce

object.set('$$$', 'o_O', {
  error: function (thisObj, err) {
    // err is ParseError.INVALID_KEY_NAME but doesn't have an error message.
  },
});

Actual Outcome

If option not passed, error is silently handled

Expected Outcome

An Error should be thrown

Environment

Server

  • Parse Server version: 6.1.0
  • Operating system: MacOS
  • Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc): local

Database

  • System (MongoDB or Postgres): Mongo
  • Database version: 6.0.29
  • Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc): local

Client

  • Parse JS SDK version: 5.0.0

Logs

Metadata

Metadata

Assignees

No one assigned

    Labels

    state:breakingBreaking change requires major version increment and `BREAKING CHANGE` commit messagestate:releasedReleased as stable versionstate:released-alphaReleased as alpha versiontype:featureNew feature or improvement of existing feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions