-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Description
Issue Description
On hosted Parse we had a construct in our CloudCode where we unset a ParseFile (User.thumbnail) in the beforeSave of a user object if another field in the object (User.image) was dirty. In the afterSave we then checked if the object does not have a value for the field (!User.has("thumbnail")) and then filled it with a new value. With the new setup this doesn't work anymore because !User.has("thumbnail") is never true nor is User.get("thumbnail") == null in the afterSave and therefore the thumbnail will never be set to its new value.
Today I rearranged the code so that the thumbnail generation takes place in the beforeSave but maybe there are other people struggling with this exact problem.
Steps to reproduce
- Use the
beforeSaveof the class User tounsetaParseFile-field - Check if the field is empty in the
afterSavewith!request.object.has("fieldName") - The field is neither
nullnor is!request.object.has("fieldName")
Expected Results
!request.object.has("fieldName") should be true in the afterSave
Actual Outcome
!request.object.has("fieldName") is false
Environment Setup
- Server
- parse-server version: 2.2.10
- Operating System: OSX 10.11.5 / Amazon Linux
- Localhost / AWS Elastic Beanstalk
- Database
- MongoDB version: 3.2
- Storage engine: default
- Localhost / AWS EC2