Parse-SDK-JS
Parse-SDK-JS copied to clipboard
`Parse.Object.set` sliently handles validation errors
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 versions of Parse Server and the Parse JS SDK.
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
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.