parse-server icon indicating copy to clipboard operation
parse-server copied to clipboard

LiveQuery pointer comparison does not handle null

Open massimilianogalanti opened this issue 3 years ago • 8 comments
trafficstars

New Feature / Enhancement Checklist

Current Limitation

Current QueryTools.js implementation protects itself from undefined objects but not from null objects. By using Parse Dashboard, it happens to create nulls instead of undefineds.

Feature / Enhancement Description

Checking for undefined and null. ((typeof obj !== 'undefined') && obj !== null)

Example Use Case

Register a livequery with a comparison on a pointer, then put that pointer to null (by code or by dashboard)

Alternatives / Workarounds

Use unset?

3rd Party References

massimilianogalanti avatar Apr 07 '22 15:04 massimilianogalanti

Thanks for opening this issue!

  • 🎉 We are excited about your ideas for improvement!

Is this actually a bug?

mtrezza avatar Apr 09 '22 19:04 mtrezza

It is unclear to me if putting Pointers to null instead of undefining them is an acceptable practice in parse server. If it is, then probably not protecting against it is a bug.

massimilianogalanti avatar Apr 09 '22 20:04 massimilianogalanti

Yes, I've also faced the same issue. setting pointer to a null value results in exception. If this null is not a valid value for pointers, it'd be helpful if we document it.

hariprasadiit avatar May 08 '22 15:05 hariprasadiit

Any news on this?

massimilianogalanti avatar Jun 16 '22 08:06 massimilianogalanti

What is the exception being thrown?

mtrezza avatar Jun 16 '22 11:06 mtrezza