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

Problem upgrading from anonymous user #1136

Closed
3 tasks done
lolobosse opened this issue Mar 22, 2016 · 7 comments · Fixed by #1142
Closed
3 tasks done

Problem upgrading from anonymous user #1136

lolobosse opened this issue Mar 22, 2016 · 7 comments · Fixed by #1142
Assignees

Comments

@lolobosse
Copy link

For implementation related questions or technical support, please refer to the Stack Overflow and Server Fault communities.

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

What is the issue?

I recreate an issue but it is related to #639 . Please do not close it yet and let me explain the problem 😄 First the issue is not a problem itself and having "anonymous": null is perfectly fine. So I think it makes sense to create an issue which cares about this possible bug (at least @flovilmart marked as bug on the other issue).

Environment Setup

VERBOSE=1

Steps to reproduce

That's the biggest issue, it happens only on mobile because it is related to the anonymous feature which has been thought for mobile only. However I succeed to make two flavours of my app (however it is closed source, so I hope we can solve the bug without needing my app yet, I can provide access for further investigations but not to the whole world 😆). One flavour is on the parse.com and the other is running the latest vanilla version of my server.

As you may expect the Parse.com is slower but works perfectly and the bug only concerns Parse-Server.

Logs/Trace

Let's try to debug it without the app; here are the curl and the response from Parse.com (working):

curl -H "X-Parse-OS-Version: 5.1.1" -H "X-Parse-App-Build-Version: 2600" -H "X-Parse-Client-Key: SpMJdbK3bjpSLsjObOqbrXK9anPgSPmUhNbRWOc1" -H "X-Parse-Client-Version: a1.13.0" -H "X-Parse-App-Display-Version: 0.2.69" -H "X-Parse-Installation-Id: 64043607-6efc-40f0-922a-28e2ff80ea8e" -H "User-Agent: Parse Android SDK 1.13.0 (jobninja.eu.jobninja.local.debug/2600) API Level 22" -H "X-Parse-Session-Token: r:0dGnBqRP4QqBd7WttLYBBBkKT" -H "X-Parse-Application-Id: 0XvfzNl5TNXfUvrGE0Z6nmTdYdYE7ob6adx6HFM0" -H "Content-Type: application/json" -H "Host: api.parse.com" -H "Pragma: no-cache" -H "Cache-Control: no-cache" --data-binary '{"username":"hhhhj@vvv.nnn","password":"jjhfhv","authData":{"anonymous":null},"objectId":"MxPu5cndJy"}' -X PUT --compressed https://api.parse.com/1/classes/_User/MxPu5cndJy

Response:

{
    "updatedAt": "2016-03-22T19:59:32.828Z",
    "username": "hhhhj@vvv.nnn"
}

User is updated, everything fine; then I try to login:

curl -H "X-Parse-Revocable-Session: 1" -H "X-Parse-OS-Version: 5.1.1" -H "X-Parse-App-Build-Version: 2600" -H "X-Parse-Client-Key: SpMJdbK3bjpSLsjObOqbrXK9anPgSPmUhNbRWOc1" -H "X-Parse-Client-Version: a1.13.0" -H "X-Parse-App-Display-Version: 0.2.69" -H "X-Parse-Installation-Id: 64043607-6efc-40f0-922a-28e2ff80ea8e" -H "User-Agent: Parse Android SDK 1.13.0 (jobninja.eu.jobninja.local.debug/2600) API Level 22" -H "X-Parse-Application-Id: 0XvfzNl5TNXfUvrGE0Z6nmTdYdYE7ob6adx6HFM0" -H "Content-Type: application/json" -H "Host: api.parse.com" -H "Pragma: no-cache" -H "Cache-Control: no-cache" --data-binary '{"username":"hhhhj@vvv.nnn","password":"jjhfhv","_method":"GET"}' --compressed https://api.parse.com/1/login

Response, working:

{
    "createdAt": "2016-03-22T19:59:02.848Z",
    "objectId": "MxPu5cndJy",
    "sessionToken": "r:YiwU9Go4haDaxnYZ2tpGkjLIz",
    "updatedAt": "2016-03-22T19:59:32.828Z",
    "username": "hhhhj@vvv.nnn"
}

The Parse-server, not working:

curl -H "X-Parse-OS-Version: 5.1.1" -H "X-Parse-App-Build-Version: 2600" -H "X-Parse-Client-Key: ywXpuXNYXggXZGcuAPQd3IX7d0hzPwgl3yMkKdXt" -H "X-Parse-Client-Version: a1.13.0" -H "X-Parse-App-Display-Version: 0.2.69" -H "X-Parse-Installation-Id: 90a6ccc3-978b-487c-89d4-5212d21d2101" -H "User-Agent: Parse Android SDK 1.13.0 (jobninja.eu.jobninja.local.debug/2600) API Level 22" -H "X-Parse-Session-Token: r:03de9f0b75520d26313769207ffc8ad6" -H "X-Parse-Application-Id: 0B5jvlihE6yxQed1w9vRSRW0DRldy3fbwqaCjpyF" -H "Content-Type: application/json" -H "Host: www.jobninja.eu:1337" -H "Pragma: no-cache" -H "Cache-Control: no-cache" --data-binary '{"username":"nsjjd@nynnd.xnn","password":"xjnxmx","authData":{"anonymous":null},"objectId":"94rmavUqMF"}' -X PUT --compressed http://www.jobninja.eu:1337/parse/classes/_User/94rmavUqMF

Response:

{
    "updatedAt": "2016-03-22T19:38:55.346Z"
}

Login:

curl -H "X-Parse-Revocable-Session: 1" -H "X-Parse-OS-Version: 5.1.1" -H "X-Parse-App-Build-Version: 2600" -H "X-Parse-Client-Key: ywXpuXNYXggXZGcuAPQd3IX7d0hzPwgl3yMkKdXt" -H "X-Parse-Client-Version: a1.13.0" -H "X-Parse-App-Display-Version: 0.2.69" -H "X-Parse-Installation-Id: 756c0f48-f330-4ef8-9c56-738fb519f630" -H "User-Agent: Parse Android SDK 1.13.0 (jobninja.eu.jobninja.local.debug/2600) API Level 22" -H "X-Parse-Application-Id: 0B5jvlihE6yxQed1w9vRSRW0DRldy3fbwqaCjpyF" -H "Content-Type: application/json" -H "Host: www.jobninja.eu:1337" -H "Pragma: no-cache" -H "Cache-Control: no-cache" --data-binary '{"username":"hdhdjd@nnxx.nnc","password":"jxjcjc","_method":"GET"}' --compressed http://www.jobninja.eu:1337/parse/login

Response (of course I just call login when I returned from signup):

{
    "code": 101,
    "error": "Invalid username/password."
}

So I guess the transformation is not done properly in the server but it stills return a successful response.

Another way of seeing it is that the username is not updated in the parse dashboard.

Btw, I hope it can get fixed soon because we're waiting for this to go online 🎉 🎉 😆 🚀 🔥

@gfosco
Copy link
Contributor

gfosco commented Mar 22, 2016

Thank you for providing detailed request/response logs... We'll take a look asap.

@gfosco gfosco changed the title Anonymous Signup doesn't seem to work properly Problem upgrading from anonymous user Mar 22, 2016
@flovilmart flovilmart self-assigned this Mar 23, 2016
@flovilmart
Copy link
Contributor

@lolobosse the PR is in review, a stupidity from my craft...

@lolobosse
Copy link
Author

Hey @flovilmart, I wanted to try your fix but I somehow failed at it,

Maybe to speed up the process, it can be something cool not only to give the instruction to run the server in "prod" mode but also in dev mode (from source), where the people can play with the code.

Do you have a Readme How to build from source? because I'm battling against it.

What I tried was: npm install npm run build npm run start (with all required options) but I still get ParseServer is not defined 😢

I tried npm build dev too but not more success

If you can give me some directions for that (I'm very bad at configuring but a real pitbull at debugging 😉 🐶 )

Btw how do you handle config file in dev mode?

Actually I think to doc is missing for contributing properly when not familiar with NPM and JS in general.

@flovilmart
Copy link
Contributor

@lolobosse Usually I don't run from source but rely on unit tests to implement the fixes. I use the VERBOSE=1, debug is tricky as we transpile with Babel and don't build the source maps.

@lolobosse
Copy link
Author

I succeed, modified the lib code directly, works fine 😉

@flovilmart
Copy link
Contributor

With the PR fix?

@lolobosse
Copy link
Author

Yes with the PR FIx

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 a pull request may close this issue.

3 participants