Skip to content
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

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

Closed
RahulLanjewar93 opened this issue Dec 14, 2023 · 11 comments · Fixed by #8835
Closed
Labels
state:released Released as stable version state:released-alpha Released as alpha version state:released-beta Released as beta version type:bug Impaired feature or lacking behavior that is likely assumed

Comments

@RahulLanjewar93
Copy link
Contributor

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

  • Parse Server version: 5.5.5
  • Operating system: Mac
  • Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc): self hosted

Database

  • System (MongoDB or Postgres): Mongo
  • Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc): Local

Client

  • SDK (iOS, Android, JavaScript, PHP, Unity, etc): Javascript
  • SDK version: 4.0.1

Logs

Copy link

Thanks for opening this issue!

  • 🚀 You can help us to fix this issue faster by opening a pull request with a failing test. See our Contribution Guide for how to make a pull request, or read our New Contributor's Guide if this is your first time contributing.

@RahulLanjewar93
Copy link
Contributor Author

@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
Copy link
Contributor Author

@mtrezza please have a look

@mtrezza mtrezza added the type:bug Impaired feature or lacking behavior that is likely assumed label May 16, 2024
@mtrezza
Copy link
Member

mtrezza commented May 16, 2024

Will this issue be fixed by parse-community/Parse-SDK-JS#2102 once the Parse SDK is upgraded in Parse Server? @dplewis

@dplewis
Copy link
Member

dplewis commented May 16, 2024

@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
Copy link
Member

mtrezza commented May 16, 2024

@RahulLanjewar93 do you want to give it a try?

@RahulLanjewar93
Copy link
Contributor Author

@RahulLanjewar93 do you want to give it a try?

sure!

@RahulLanjewar93
Copy link
Contributor Author

@RahulLanjewar93 do you want to give it a try?

added required change in #8835

@parseplatformorg
Copy link
Contributor

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

@parseplatformorg parseplatformorg added the state:released-alpha Released as alpha version label Jun 11, 2024
@parseplatformorg
Copy link
Contributor

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

@parseplatformorg parseplatformorg added the state:released-beta Released as beta version label Jun 30, 2024
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 7.1.0

@parseplatformorg parseplatformorg added the state:released Released as stable version label Jun 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state:released Released as stable version state:released-alpha Released as alpha version state:released-beta Released as beta version type:bug Impaired feature or lacking behavior that is likely assumed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants