Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse.Object.set sliently handles validation errors #2104

Open
4 tasks done
dplewis opened this issue Apr 13, 2024 · 1 comment
Open
4 tasks done

Parse.Object.set sliently handles validation errors #2104

dplewis opened this issue Apr 13, 2024 · 1 comment
Labels
state:breaking Breaking change requires major version increment and `BREAKING CHANGE` commit message type:feature New feature or improvement of existing feature

Comments

@dplewis
Copy link
Member

dplewis commented Apr 13, 2024

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.

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

Copy link

Thanks for opening this issue!

  • 🚀 You can help us to fix this issue faster by opening a pull request with a failing test. See our Contribution Guide for how to make a pull request, or read our New Contributor's Guide if this is your first time contributing.

@mtrezza mtrezza added type:feature New feature or improvement of existing feature state:breaking Breaking change requires major version increment and `BREAKING CHANGE` commit message labels Apr 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state:breaking Breaking change requires major version increment and `BREAKING CHANGE` commit message type:feature New feature or improvement of existing feature
Projects
None yet
Development

No branches or pull requests

2 participants