Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix getting user roles from cache #2034

Merged
merged 1 commit into from
Jun 12, 2016
Merged

fix getting user roles from cache #2034

merged 1 commit into from
Jun 12, 2016

Conversation

joy4eg
Copy link
Contributor

@joy4eg joy4eg commented Jun 11, 2016

Hi,

In some cases, DELETE operation can really delete the object only on second try.
On the first try, parse-server trying to get user roles from cache (and it looks like it failed).
On the second, we will create a REST request to obtain roles, and re-cache them, this code is OK.

Here is the a log with VERBOSE=1:

parse-v1-1 verbose: DELETE /api/v1/classes/WatcherTask/Bp7JHCWB2c { 'x-real-ip': 'X.X.X.X',
parse-v1-1   'x-nginx-proxy': 'true',
parse-v1-1   'x-forwarded-proto': 'https',
parse-v1-1   connection: 'close',
parse-v1-1   'content-length': '0',
parse-v1-1   'x-parse-os-version': '6.0.1',
parse-v1-1   'x-parse-client-version': 'a1.13.1',
parse-v1-1   'user-agent': 'Parse Android SDK 1.13.1 (XXX/YYY) API Level 23',
parse-v1-1   'x-parse-session-token': 'r:f8e5409b8e61e3884478f24efdcf4d9e',
parse-v1-1   'content-type': 'application/x-www-form-urlencoded',
parse-v1-1   'accept-encoding': 'gzip' } {}
parse-v1-1 auth.userRoles: []
parse-v1-1 DEL: options: {"acl":["*","LogIcQd9Td"]}
parse-v1-1 Mongo where: {"_id":"Bp7JHCWB2c","_wperm":{"$in":[null,"*","LogIcQd9Td"]}}
parse-v1-1 verbose: error: code=101, message=Object not found.

And now with this commit included:

parse-v1-1 verbose: DELETE /api/v1/classes/WatcherTask/Bp7JHCWB2c { 'x-real-ip': 'X.X.X.X',
parse-v1-1   'x-nginx-proxy': 'true',
parse-v1-1   'x-forwarded-proto': 'https',
parse-v1-1   connection: 'close',
parse-v1-1   'content-length': '0',
parse-v1-1   'x-parse-os-version': '6.0.1',
parse-v1-1   'x-parse-client-version': 'a1.13.1',
parse-v1-1   'user-agent': 'Parse Android SDK 1.13.1 (XXX/YYY) API Level 23',
parse-v1-1   'x-parse-session-token': 'r:f8e5409b8e61e3884478f24efdcf4d9e',
parse-v1-1   'content-type': 'application/x-www-form-urlencoded',
parse-v1-1   'accept-encoding': 'gzip' } {}
parse-v1-1 auth.userRoles: ["role:pt_240d22f4-8065-49f9-b609-18f5f35ed8ab"]
parse-v1-1 DEL: options: {"acl":["*","LogIcQd9Td","role:pt_240d22f4-8065-49f9-b609-18f5f35ed8ab"]}
parse-v1-1 Mongo where: {"_id":"Bp7JHCWB2c","_wperm":{"$in":[null,"*","LogIcQd9Td","role:pt_240d22f4-8065-49f9-b609-18f5f35ed8ab"]}}
parse-v1-1 verbose: {
parse-v1-1   "response": {}
parse-v1-1 }

@drew-gross
Copy link
Contributor

Cool, I think this makes sense. @blacha can you confirm?

@drew-gross
Copy link
Contributor

OK yeah this has to make sense. Took a closer look at the code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants