parse-community / parse-community/parse-server
Unexpected behavior on the `exists` method
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 21.4k
- Forks
- 4.8k
- Avg merge
- 7h 45m
- Merged PRs (30d)
- 11
Description
Issue Description
An object exists in the database. You need a sessionToken to access it.
If you use the Parse.Object exists method without sessionToken instead of throwing an error, it resolves with the value false. I think it's quite an unexpected behavior. It's caused by theses lines of code
And comes from this discussion : https://github.com/parse-community/Parse-SDK-JS/pull/898#discussion_r316447203
Steps to reproduce
- Create an object in database with limited access
- Try Catch the exits method without any sessionToken
Expected Results
It should throw an error
Actual Outcome
It does not throw, it returns false as if the object do not exist
Test Case
To accurately reproduce your issue. Add your test cases here and read the Contributing Guide to run the tests.
Environment Setup
-
Server
- parse-server version (Be specific! Don't say 'latest'.) : 4.1.0
- Operating System: MacOS
- Localhost or remote server? localhost
-
JS SDK
- JS SDK version: [FILL THIS OUT]
- Application? (Browser, Node, React-Native, etc): [FILL THIS OUT]
Logs/Trace
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 the linked ParseObject.js lines that implement the exists method, then review the integration tests under the Parse-SDK-JS integration/test directory. Reproduce the limited-access object case without a sessionToken and confirm that the completed behavior matches the issue's expected error handling.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100