parse-server
parse-server copied to clipboard
fix: LiveQuery throws on `create` event using `Parse.Query.containedIn` with `null` value in array or using `Parse.Query.equalTo` for `Parse.Object` with key value `null`
trafficstars
Pull Request
- Report security issues confidentially.
- Any contribution is under this license.
- Link this pull request to an issue.
Issue
Live query throw error if we create subsciption for
ParentObjectQuery.containedIn('childs', [...childs,null])and a ParentObject is created withParentObject.set('childs',[newChild]ParentObjectQuery.equalTo('child', child)and a ParentObject is created withParentObject.set('child',null)
Closes: FILL_THIS_OUT
Approach
Add not null and not object check before doing the actual checks
Tasks
- [x] Add tests
Summary by CodeRabbit
- Tests
- Added new test cases to ensure live queries involving pointer fields and null values operate reliably without causing server errors or crashes.
- Bug Fixes
- Improved stability by adding checks to prevent errors when handling null or undefined pointer values in live queries.