parse-community / parse-community/parse-server

Cannot read .indexOf undefined on matchesKeyConstraints when attribute missing

Open
#7,416 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type:bug
Dominant language
JavaScript
Stars
21.4k
Forks
4.8k
Avg merge
7h 45m
Merged PRs (30d)
11

Description

New Issue Checklist
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.