-
-
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
set('key', undefined) in Cloud Code does not result in key being undefined in beforeSave #1942
Comments
When not providing any value, the JS-SDK will interpolate it as a no-op as this is equivalent as calling |
@flovilmart I'm not sure I understand. As the test in my PR shows, calling e.g.:
|
The main issue is that undefined is not serializable, so anything that gets set to undefined server side can't be forwarded to the client, unless a fetch is done. |
It still affects Cloud Code functions that modify and then return an object (i.e. most things not the result of a client-side |
You should use unset, and unset itself is broken, as you noticed. I've opened PR on the iOS and JS SDK's to improve that. |
Great, thanks for the clarifications. |
@flovilmart I maybe have a problem that is related to the mentioned brokenness of |
Saving an object after calling
set('key', undefined)
does not result inkey
beingundefined
inbeforeSave
. Once beforeSave has completed and the save call returns,key
isundefined
as expected.This might be related to #1840. Test incoming.
The text was updated successfully, but these errors were encountered: