-
-
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
Fix dirtyKeys() and dirty(key:) on beforeSave when updating objects. #614
Conversation
it('test beforeSave get dirtyKeys on update', function(done) { | ||
var triggerTime = 0; | ||
// Register a mock beforeSave hook | ||
Parse.Cloud.beforeSave('GameScore', function(req, res) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How is this going to interact with cloud code in other tests? If every cloud code test is modifying some global that seems like it could get messy fast.
Up to you if you want to do anything about that test comment. |
@natanrolnik Yup, know about #581, but missed #419. Thanks, attaching the other one to the PR, so it's automatically closed when this is merged. |
8fcead8
to
24a25d1
Compare
Updated a little bit - the core logic didn't change, but unified all tests into a single |
@nlutsenko updated the pull request. |
I'm not 100% sure, but I believe what is actually happening with |
Huh, that might be true actually... Weird. |
Fix dirtyKeys() and dirty(key:) on beforeSave when updating objects.
Any idea when this will be in a tagged release so our package.json will pick it up? |
Probably today or tomorrow. |
Properly reconstruct the full object by applying values one-by-one to the original object if it's an object update.
There is another small piece missing - removing support for
_Session
triggers, which will unblock us on using the same approach for re-constructingdirtyKeys()
on object creation inbeforeSave()
.Fixes #581, fixes #419