-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Inconsistency with request.user (resulting in null in some cases) after migration #775
Comments
As I have been reading, I understand that if your user on the client app is still sending a non-revocable session (old method) then this will result in request.user = null and cloud code will fail. Check your headers in your Post. If you're using JS SDK you'll need to look at a wireshark trace because the session info and application info is in the data and not the headers. |
I'd like to add that we currently have no issues when pointing to parse.com. This only manifests when pointing to our own Parse Server. Are you saying that the issues we are hitting are due to an issue on the client side itself? We have not made any changes for sessions on iOS or Android. |
@sprabs do you use revocable sessions or the old sessions? |
@flovilmart we are still using the old sessions in production. It works fine when pointing to parse.com. |
I belive old sessions are not supported in parse-server, and they most likely won't be supported. |
Yes, but here-in lies the problem. Parse-Server is not reporting that user is not using revocable session. This causes silent failures (request.user = null). We need to throw an error so the user can re-login. |
If the client don't enable revokable sessions that won't help either. You should migrate your users to revokable sessions before starting using parse-server. there https://www.parse.com/tutorials/session-migration-tutorial |
@flovilmart @nitrag Thanks for this feedback. I just followed the documentation and added the necessary code on the iOS client side and created a new user in our test environment. Now, I am hitting a new issue: Uncaught internal server error. [TypeError: Cannot read property 'query' of undefined] TypeError: Cannot read property 'query' of undefined My code is querying a relation. It doesn't seem to like this. We query relations a lot. Is this a bug with parse-server or is there some modifications that I need to make in order to get this to work? |
@sprabs You'd need to find out which line is accessing a |
This is now a duplicate of #782. Please continue discussion there. |
Hello @gfosco I think #782 is another discussion regarding the query. I'm still with this issue with the Still, I'm trying to make the user to relog-in when this happens, or the sessionToken is invalid. So in my cloud I have this code:
So in Android, in case I get error = INVALID_SESSION_TOKEN (209) or error = 141 + message = "INVALID_SESSION_TOKEN", I make the user log in again:
but In Android: I've been debugging the whole process: EDIT (more specific): so the
|
Was there a solution to this? I'm facing the same issue against parse.com (not parse-server), with the same steps from above:
(We have just started using ParseUser.enableRevocableSessionInBackground() in our Android app in preparation for migrating to parse-server) |
In my case, calling to a Parse Cloud function was ok, but inside the function I was calling another separate Cloud function. That was where I was losing my |
We have setup our own Parse Server on AWS and have gone through the guide. Our deployed Cloud Code is working in some cases, but we are hitting issues in our conversion from Parse.User.current() to request.user. It works for basic information like to retrieve the current user's id, but when we normally were doing something like Parse.User.current().get("favoriteTeams") that does not seem to convert as expected to request.user.get("favoriteTeams").
We consistently see this (or a similar) error:
Uncaught internal server error. [TypeError: Cannot read property 'get' of null] TypeError: Cannot read property 'get' of null at Object.fetchNewPostsData (/var/app/current/cloud/main.js:2973:42)
I have also noticed this in the logs:
BUG: the handler did not include a "response" field
I have not been able to find documentation related to this and Hector told me to post the issue here. How do you suggest we resolve this issue?
The text was updated successfully, but these errors were encountered: