parse-server icon indicating copy to clipboard operation
parse-server copied to clipboard

`include` on Queries can cause root query to fail with 101 when an included pointer is deleted / unreadable, without indicating which parent field failed.

Open swittk opened this issue 2 months ago • 2 comments

New Issue Checklist

Issue Description

Queries that use include (e.g. include=author,comments.author) fail the entire root query with ParseError 101 (OBJECT_NOT_FOUND) if any included pointer can’t be resolved (e.g. deleted child, ACL/CLP denied). The error doesn’t identify which parent object / field caused the failure, making it hard to handle gracefully. This also affects single-object reads done via fetchWithInclude (JS SDK).

Steps to reproduce

  1. Create a new post with a valid user const post = new Post({ title, message, author: Pointer<_User> }); await post.save().
  2. Delete that author user (or make it unreadable to the requesting client).
  3. GET /classes/Post?include=author (or run an equivalent SDK query).

Actual Outcome

101 (OBJECT_NOT_FOUND) error for the whole query.

Expected Outcome

Return the Post and surface the missing include in a tolerant way (e.g., author: null) or provide error context indicating which include failed, with potentially a way to handle the nested fields when unavailable.

Proposal : a backwards-compatible option of per-request override: includeMissing=<error|null|unset|pointer> forwarded to the include resolver.

  • 'error' (default) : current behavior.
  • 'null': set missing child to null (arrays keep position with null).
  • 'unset': remove the field; arrays drop missing items.
  • 'pointer': returns unresolved items as raw pointer JSON.

Environment

Server

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

Database

  • System (MongoDB or Postgres): MongoDB
  • Database version: 8
  • Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc): Self hosted

Client

  • SDK (iOS, Android, JavaScript, PHP, Unity, etc): JS
  • SDK version: 6.x

Logs

swittk avatar Oct 06 '25 21:10 swittk

🚀 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.

I've implemented a potential solution in the PR that implements a boolean flag, pointers to objects that are no longer accessible are returned as raw pointers, while the ones that are accessible are hydrated fully.

swittk avatar Oct 09 '25 14:10 swittk