Cloud code: Dirty flag on properties always returnes false.
In Cloud code when using "is dirty" method on a property on any PatseObject, it will always return false. The cloud code I'm running is working as expected on parse hosted server, so this is an issue with this code.
Probably best to give example code, and if anything shows up in the parse server logs, if not enable VERBOSE = 1 as an environment variable that might spit out more info.
Nothing special actually. Setting a numeric property in the android parse sdk. Saving object. Before save in cloud code, exec is dirty method on that object, giving that property name ==> returns false.
As I mentioned, the parse hosted server works as expected. There it'll return true.
There's some work to be done here to match the hosted cloud code functionality. Some of this was done in parse-cloud-express for webhook usage and just needs to be implemented here.
Ok thanks! Waiting for a fix.
any ETA on this?
No ETA just yet, you are very welcome to jump in and look into ways to fix it, but I am going to tackle this today/tomorrow.
Got the working solution for object updates, but looks like we also expose dirtyKeys() for created objects - working on the solution right now.
Hi, is this fixed?
Fixed, coming in the next version.
The opposite happens with me. dirty seems to be always returning true (in beforeSave) and that's causing problems with my cloud code logic (version 2.1.5).
If the object was mutated for a save - it should be dirty, since the changes are not yet applied.
This behavior is consistent with parse.com implementation, so I don't think we should change it.
@xissburg, let's try debugging and fixing your logic together, you can open another issue or we can continue here...