-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
beforeSave() hook causes "Object Not Found" error #6195
Comments
If you remove the beforeSave hook do the objects save? |
Yes, if I remove beforeSave hook, object saves and exists in DB. I may have isolated the issue already. I added some logs, it seems that if one of the Number object field is 0, the this.config.database.create call will fail to return an object. I will upload some logs later tonight. |
@drhuanliu any updates? |
Same issue here. beforeSave() was not triggered for only one parse subclass. After investigation/debugging, turned out I was using a field/column named "length" on that parse subclass. Renaming that column fixed the issue. Believe the error is being thrown because of one line in RestWrite.js:
result.length returns 0 when the 'length' column value is 0. |
@wqzyow That is interesting. We can do a PR for that. @drhuanliu Are you experiencing anything similar? |
This can be reproduced without involving beforeSave |
Thanks for confirming. Would you be willing to open a PR for this and start by adding a failing test case? |
Issue Description
I just upgrade from Parse Server 2.7 to 3.9, and this new issue starts to happen:
I trace the error to line 209 of RestWrite.js. Apparently, this call
databasePromise = this.config.database.create(this.className, this.data, this.runOptions, true);
does not return back an object, resulting in throwing an exception.
Here is what I know:
Could you please take a look at that section of the RestWrite.js code, and see what could potentially be causing it to raise an exception?
Steps to reproduce
Expected Results
Actual Outcome
Environment Setup
Server
Database
Logs/Trace
Include all relevant logs. You can turn on additional logging by configuring VERBOSE=1 in your environment.
The text was updated successfully, but these errors were encountered: