parse-community / parse-community/parse-server

Parse.Object.save throws wrong "101 Object not found." error

Open
#9,649 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

New Issue Checklist
Issue Description

Parse.Object.save throws "Object not found.", code 101 error when trying to save an existing object with the session token of a user that does not have write permissions on that object.

Steps to reproduce

Fetch a valid object that can be read by everyone, using a query.

const query = ...;
const result = await query.first();
log(result.get("key")); // Will show a valid value here since the user has read permission.

Set any value on the object and try to save it using the session token of a user who does not have write access for the object.

result.set("key", 1);
await result.save(null, { sessionToken: "valid_session_token_without_write_access" }); 
// Throws a 101 error because the user does not have write permission. The error code should probably be a different one though.
Actual Outcome

101: OBJECT_NOT_FOUND error is thrown.

Expected Outcome

Other error should be thrown:

  • 209: INVALID_SESSION_TOKEN
  • 119: OPERATION_FORBIDDEN
  • Other new error code...
Environment

Tested on the versions mentioned below only.

Server

  • Parse Server version: 8.0.0
  • Operating system: Ubuntu
  • Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc): Self Hosted Remote

Database

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

Client

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

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 by tracing the Parse.Object.save request and the server's handling of an existing readable object when the session lacks write permission; the issue does not name specific files or tests. Reproduce the MongoDB case with the supplied JavaScript steps, then verify that the resulting error code matches the decided permission or session-token behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, mongodb
Domain
api, authorization, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.