Skip to content

Parse server seems to return incorrect count if master key is provided #1690

Closed
@xor22h

Description

@xor22h

Check out this issue for an ideal bug report. The closer your issue report is to that one, the more likely we are to be able to help, and the more likely we will be to fix the issue quickly!

For implementation related questions or technical support, please refer to the Stack Overflow and Server Fault communities. For database migration help, please file a bug report.

Make sure these boxes are checked before submitting your issue -- thanks for reporting issues back to Parse Server!

Parse server seems to return incorrect count if master key is provided.

Steps to reproduce

Request from parse-dashboard (Chrome dev tools / Copy as CURL)

$ curl 'https://SERVER_ADDRESS/classes/DiscoverLike' 
-H 'pragma: no-cache' 
-H 'accept-encoding: gzip, deflate' 
-H 'accept-language: en-US,en;q=0.8,lt;q=0.6,ru;q=0.4' 
-H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.86 Safari/537.36' 
-H 'content-type: text/plain' 
-H 'accept: */*' 
-H 'cache-control: no-cache' 
--data-binary '{"where":{},"limit":0,"count":1,"_method":"GET","_ApplicationId":"1B804BBB-581B-4AE0-8A48-33E017B4D1F2","_ClientVersion":"js1.6.14","_MasterKey":"REMOVED_FOR_PRIVACY"}' 
--compressed | underscore pretty

Response:

{ results: [ ], count: -1 }

Modified request with removed _MasterKey;

$ curl 'https://SERVER_ADDRESS/classes/DiscoverLike' 
-H 'pragma: no-cache' 
-H 'accept-encoding: gzip, deflate' 
-H 'accept-language: en-US,en;q=0.8,lt;q=0.6,ru;q=0.4' 
-H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.86 Safari/537.36' 
-H 'content-type: text/plain'
-H 'accept: */*' 
-H 'cache-control: no-cache' 
--data-binary '{"where":{},"limit":0,"count":1,"_method":"GET","_ApplicationId":"1B804BBB-581B-4AE0-8A48-33E017B4D1F2","_ClientVersion":"js1.6.14"}' 
--compressed | underscore pretty

Response: (As expected)

{ results: [ ], count: 13 }

Logs/Trace

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions