-
-
Notifications
You must be signed in to change notification settings - Fork 735
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
Users are logged out after SDK upgrade #1158
Comments
Thanks for opening this issue!
|
If you look at the commits, are you able to tell which commit may cause this? |
In version 3.0.0 a breaking changes was introduced:
Is very likely that internally the user was saved in the old place and after the upgrade the new one is used where the user cannot be found. If that is correct we can think about implementing a proper migration of the user or/and installation. From what I remember, there was actually some kind of migration, but I need to double-check what covers. Nice catch @qmetzler-luna |
@L3K0V if you could verify this, we may retroactively add a warning note to the changelog even before we publish a fix; this could be quite a severe issue if all users who update their app get logged out. I'll at least pin this for now. |
I have done quick debugging on this and it is indeed a serious bug. This commit 7d0faa3#diff-c26dc69a408628b0da844de58b3d793a777cc908e5dde1777e2b54744de5d2bdL131 actually changed where the SDK looks up Previously these were stored under Newly they are looked up under currentUser
currentInstallation
installationId
The not so trivial fix would be to check whether these files exist at their old locations and move them over to new locations before the SDK has a chance to look them up. |
I agree that this is a serious bug as it effectively logs out every user. Sounds like a rather trivial fix to me. Would you want to open a PR for this? |
@mtrezza What's your idea of a trivial fix? If we just revert back to loading at least So the fix should be more elaborate, essentially trying to see if the file is present at new location, and use that (assuming login happened on 3.0.0), and if it is not present, trying to move previous file from old location to a new location and use that (assuming user was logged in on 1.x or 2.x). In any case, looking that 3.0.0 was released Nov 21, it's potentially now out in the wild for several months ideal fix would not break anything again. Your thoughts? |
@mtrezza More over, thanks, |
@mman about
I did the changes because the old |
First of all, I'm glad we identified this issue. It actually sounds more like a bug than a breaking change, because there is virtually nothing the developer can do except for writing their own migration routine, which is such an internal matter that it should be done by the SDK. A trivial fix could be:
If someone has both paths already then I wouldn't do any migration and just delete the old path. In any case, we should add a warning note to the affected versions in the changelog (and GitHub releases page) ASAP, every day more may cause more damage. Anyone wants to open a PR? |
I will have no availability this and next 2-3 weeks. Sorry. Only have time to follow discussions and doing some reviews if necessary. |
@L3K0V If you could do a review that would already help a lot. @mman Would you be up to write a fix? We'll add a bounty to this for urgency so it's compensated as well. I've added a note to the GH release & changelog:
|
@mtrezza I will not be able to look into it in the next few days, perhaps next week depending on what pops up :( |
ParsePlugins :: - `getCacheDir()`, `getFilesDir()` APIs now has support for backward compatibility before migration to v3.0.0
Thanks to @rommansabbir who submitted the PR for cache migration to fix this issue. Could anyone try out #1168 to verify that it works? |
7d0faa3#diff-6cb14853da236c30db3f14e4005ea40c5c45cb8fcb9fc49541693186620de1dcR60 @mtrezza I remember that there was some migration functionality, but for the push notifications. I started wondering if this should be reverted? But I assumed that who is using the 1.26 and early versions which was introduced for a long long time are already migrated. For me this was a very old legacy migration. Still, similar but very slim and simplified version of such migration should be used to migrate the user, installation etc. I already posted into the PR |
Yes, I would remove old migration routines only after a very long time, if they don't hurt being there. Or if we can reasonably assume that the migration should have happened already, because previous SDK versions are not usable anymore (targetSDK version not accepted anymore on Google Play, etc) |
Note: conceptual conversation about migration is happening in #1168 |
Btw thank you all :) |
Thank you for kicking it off by opening the issue ;-) |
New Issue Checklist
Issue Description
ParseUser.getCurrentUser() becomes null after an update from
1.25.0
to3.0.0
.Steps to reproduce
1.25.0
3.0.0
Actual Outcome
I'm logout
Expected Outcome
I should be login as before
Environment
Parse Android SDK
3.0.0
API 30
Server
4.10.4
(I tried in a staging environment with5.2.0
too)Ubuntu 20.04.2 LTS
Remote host
Database
MongoDB
4.4.13
MongoDB Atlas
Logs
The text was updated successfully, but these errors were encountered: