Skip to content

Unexpected behavior on the exists method #8117

Open
@codeKonami

Description

@codeKonami

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

https://github.com/parse-community/Parse-SDK-JS/blob/f2d76805000488fefce2b0c2e73d8953007f2b1c/src/ParseObject.js#L972-L974

And comes from this discussion : parse-community/Parse-SDK-JS#898 (comment)

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:bugImpaired feature or lacking behavior that is likely assumed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions