parse-community / parse-server

Parse Server for Node.js / Express
https://parseplatform.org
Apache License 2.0
20.84k stars 4.77k forks source link

[Live Query] `matchesKeyConstraints` throwing error when `constraints` is `{$ne : null}` #8834

Closed RahulLanjewar93 closed 3 months ago

RahulLanjewar93 commented 9 months ago

New Issue Checklist

Issue Description

matchesKeyConstraints function is not handling not equal to null constraint properly. Due to which error is thrown `Cannot read properties of null (reading '__type')

image

Steps to reproduce

Create a subscription on a class with constraint notEqualTo(key,null)

Actual Outcome

Throws error.

Expected Outcome

Shouldn't throw an error.

Environment

18.19.0

Server

Database

Client

Logs

parse-github-assistant[bot] commented 9 months ago

Thanks for opening this issue!

RahulLanjewar93 commented 9 months ago

@mtrezza i think we need some changes in the code block

QueryTools.js > matchesKeyConstraints

image

here we need to check if compareTo is not null/undefined

RahulLanjewar93 commented 9 months ago

@mtrezza please have a look

mtrezza commented 4 months ago

Will this issue be fixed by https://github.com/parse-community/Parse-SDK-JS/pull/2102 once the Parse SDK is upgraded in Parse Server? @dplewis

dplewis commented 4 months ago

@mtrezza Thats a fix for the Local Datastore this issue is for LiveQuery. The query engines for both are almost the same. You can basically copy the fix over to Parse Server and it should work for Live Query.

mtrezza commented 4 months ago

@RahulLanjewar93 do you want to give it a try?

RahulLanjewar93 commented 3 months ago

@RahulLanjewar93 do you want to give it a try?

sure!

RahulLanjewar93 commented 3 months ago

@RahulLanjewar93 do you want to give it a try?

added required change in #8835

parseplatformorg commented 3 months ago

🎉 This change has been released in version 7.1.0-alpha.10

parseplatformorg commented 2 months ago

🎉 This change has been released in version 7.1.0-beta.1

parseplatformorg commented 2 months ago

🎉 This change has been released in version 7.1.0