parse-community / parse-community/parse-server
Cannot read .indexOf undefined on matchesKeyConstraints when attribute missing
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 21.4k
- Forks
- 4.8k
- Avg merge
- 7h 45m
- Merged PRs (30d)
- 11
Description
New Issue Checklist
- I am not disclosing a vulnerability.
- I am not just asking a question.
- I have searched through existing issues.
- I can reproduce the issue with the latest version of Parse Server.
Issue Description
When an object is missing an expected attribute, an unhandled error occurs.
Steps to reproduce
To be honest, I'm not sure how objects are getting malformed.
This issue is causing a crash my LiveQueryServer that listens for live queries using ParseServer.createLiveQueryServer.
Actual Outcome
Because it's outside of the context of an Express.js request, the entire node process crashes.
Expected Outcome
I'm expecting it not to crash
Failing Test Case / Pull Request
- 🤩 I submitted a PR with a fix and a test case.
- 🧐 I submitted a PR with a failing test case.
Environment
Server
- Parse Server version:
4.5.0 - Operating system:
Debian - Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc):
AWS
Database
- System (MongoDB or Postgres):
MongoDB - Database version:
4.4 - Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc):
FILL_THIS_OUT
Client
- SDK (iOS, Android, JavaScript, PHP, Unity, etc):
JavaScript - SDK version:
n/a
Logs
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at matchesKeyConstraints and trace its callers from ParseServer.createLiveQueryServer, focusing on the missing-attribute path described in the reproduction. Reproduce the LiveQueryServer crash with an object lacking the expected attribute, then verify the submitted fix and test case prevent the unhandled process crash.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- express, javascript, node.js
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100