-
-
Notifications
You must be signed in to change notification settings - Fork 734
ParseFacebookUtils.isLinked(user) returning false after executing query with 'user' key included #269
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
Comments
Sdks I am using are as following: |
Thank you for your feedback. We prioritize issues that have clear and concise repro steps. Please see our Bug Reporting Guidelines about what information should be added to this issue.
|
Hi @SobanMahmood, do you use the local datastore in your app? |
Hi @wangmengyan95 , thanks for the response. |
Hi @SobanMahmood, another question I want to know is whether you use the local datastore all the time? All the time means when you log in or link with Facebook and do the query, the local datastore is always enabled. I assume this is your case, but I just want to make sure, since we have some migration step when you first enable local datastore. I want to narrow down the scope. Thanks. |
@wangmengyan95 yeah, Local datastore is always enabled in my case. In fact it is enabled at start of the application in overridden method onCreate() of extended Application class. |
Hi @SobanMahmood, I can repo this issue. It seems a valid bug. I will try to figure out why this happen. Thanks for opening this issue! Right now I am not sure whether it is a bug of Parse or ParseFacebookUtils. If it is a bug of ParseFacebookUtils, I will create a new issue in ParseFacebookUtils and close this one. |
I find the cause of this issue. When you login, we keep an in-memory and in-disk currentUser object. When you query a ParseUser, the server will not include the authData for security reason. For you case, if you include the user key, when we get the response and try to decode it, we will try to use the incomplete data to rebuild the user. If the user is the currentUser, we will use the new-build user which is incomplete to overwrite the in-memory currentUser. That's why the ParseFacebookUtils.isLinked(ParseUser.getCurrentUser()) will return false. However, since we do not change the in-disk currentUser, when you relaunch the app, we read the currentUser from disk and ParseFacebookUtils.isLinked(ParseUser.getCurrentUser()) return the true result. |
Hi @wangmengyan95, thanks for the support. I hope this issue will get fixed in next release. Until then, is there any work around possible with the current version? |
Hi @SobanMahmood, one possible solution is after you do this kind of query, you manually fetch the currentUser by calling |
@wangmengyan95 we'd probably want to add |
Thanks @wangmengyan95 for the work around, that seems simple, I hope this will do the trick. |
I have Parse object named 'Activity' on back end, which has a pointer to 'User' object.
In my android app, after logging in or linking through ParseFacebookUtils, if I made a parse query on 'Activity' and include key 'user' to that query for fetching users' details, then ParseFacebookUtils.isLinked(ParseUser.getCurrentUser()) starts returning false after that query. However if I kill android app and relaunch it, then ParseFacebookUtils.isLinked(ParseUser.getCurrentUser()) starts returning true again. It seems as for some reason some cached data is getting affected after making query with 'user' key included. This does not happen if query is made without including key 'user'.
This happens if at least one of the fetched 'Activities' has current logged in user set as the 'user' pointer.
The text was updated successfully, but these errors were encountered: