-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Unexpected behavior on the exists
method
#8117
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
In my opinion, that's the right behavior. If the user does not have access to this object, they should not be able to know if it exists and receiving always false (no matter it exists or not) looks a good solution for me. If we throw an error, the user will know that the object exists. It also looks to me compliant with the other features, such as the count, which does not count the objects to which the user doesn't have access. @dplewis @acinader thoughts? |
@davimacedo I agree that this is expected behavior. |
I see what you mean. But if you have CLP that |
I guess that's not true. If you check the code here, you will see it throws any error that not |
This is linked to this discussion https://github.com/parse-community/Parse-SDK-JS/issues/1135
@codeKonami thanks for the PR with the test case. I pulled your branch and played around. I could reproduce the problem, but only with the parse-server/src/Controllers/SchemaController.js Line 1437 in 6b0efae
parse-server/src/Controllers/SchemaController.js Line 1442 in 6b0efae
parse-server/src/Controllers/SchemaController.js Line 1483 in 6b0efae
@dplewis agree? |
I'll transfer this to Parse Server |
Thanks for opening this issue!
|
Thanks for opening this issue!
|
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 valuefalse
. I think it's quite an unexpected behavior. It's caused by theses lines of codehttps://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
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
JS SDK
Logs/Trace
The text was updated successfully, but these errors were encountered: