Skip to content

Cloud code: Dirty flag on properties always returnes false. #581

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

Closed
degenddy opened this issue Feb 22, 2016 · 11 comments · Fixed by #614
Closed

Cloud code: Dirty flag on properties always returnes false. #581

degenddy opened this issue Feb 22, 2016 · 11 comments · Fixed by #614
Labels
type:bug Impaired feature or lacking behavior that is likely assumed

Comments

@degenddy
Copy link

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.

@gateway
Copy link

gateway commented Feb 22, 2016

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.

@degenddy
Copy link
Author

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.

@gfosco
Copy link
Contributor

gfosco commented Feb 23, 2016

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.

@gfosco gfosco added the type:bug Impaired feature or lacking behavior that is likely assumed label Feb 23, 2016
@degenddy
Copy link
Author

Ok thanks!
Waiting for a fix.

@degenddy
Copy link
Author

any ETA on this?

@nlutsenko
Copy link
Contributor

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.

@nlutsenko
Copy link
Contributor

Got the working solution for object updates, but looks like we also expose dirtyKeys() for created objects - working on the solution right now.

@degenddy
Copy link
Author

Hi, is this fixed?

@nlutsenko
Copy link
Contributor

Fixed, coming in the next version.

@xissburg
Copy link

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).

@nlutsenko
Copy link
Contributor

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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Impaired feature or lacking behavior that is likely assumed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants