-
Notifications
You must be signed in to change notification settings - Fork 226
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
Restrict independent watch functionality to Plus users #994
Conversation
@@ -69,7 +69,7 @@ class SubscriptionManagerImpl @Inject constructor( | |||
if (cachedStatus != null) { | |||
accept(Optional.of(cachedStatus)) | |||
} else { | |||
accept(Optional.of(SubscriptionStatus.Free())) | |||
accept(Optional.of(null)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made this change so that a user who is not logged in does not have SubscriptionStatus.Free
. This matters because when a Plus user logs in, there is a brief period of time where the user is signed in, but we haven't gotten their subscription status from the subscription API call yet. Before this change, the user would be signed into a plus account, but the app would report their subscription status as free. With this change, we now know that we don't have their subscription status yet because it will be null
.
I still haven't managed to reproduce this issue, but I improved the logic a bit in f4ac9b8, and I think that might help avoid the issue from happening. |
Great job in managing the tricky navigation required for this task! I tested the app for each of the listed scenarios and found it working well:
I was stuck at the login screen at times, I will continue to test and share the steps to reproduce once I find a pattern. It might have happened because the account might have many podcasts and I see we already have a task to address it:
but I think something else is also going on here. I'm not approving the PR yet as I'd like to give some more time for testing it and also review the code changes. |
I've noticed that when I change my emulator to have a slow internet connection, the refresh sometimes takes extremely long (as in, multiple minutes). It's weird because as I slow down the emulator, everything seems to work fine, and then suddenly there's a huge drop off in the speed once I slow it down past a certain point. I'm not sure what's going on there either, but just sharing in case it gives you any hints as you test further.
👍 Absolutely! Please take your time and test as much as you want. I've run into so many bugs trying to implement this, and I really appreciate you taking the time to carefully test this. |
An additional scenario worth testing is:
This is working fine for me, but I just wanted to call it out as an additional test scenario, so I'll add this to the PR description. |
I found that there is an issue where when a user signs in with a google account, the app still uses the same google account and idToken on subsequent sign in attempts even if the sign in attempt occurs after the idToken has expired (1 hour expiration). This isn't something we're doing but is happening within the google sign in libraries and horologist. I think that's the cause of some of the issues I've seen (and why I found them so hard to reproduce). I've done an update in 519a189 that avoids that issue (and also fixes #993 by allowing the user to select a different account if they want when they sign back in). When the user selects an account, we get a fresh idToken. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sign in with a Plus account
Change the account to being Free ...
This worked as expected, thanks for listing it as an additional testing scenario 👍
I found that there is an issue where when a user signs in with a google account, the app still uses the same google account and idToken on subsequent sign in attempts even if the sign in attempt occurs after the idToken has expired (1 hour expiration). This isn't something we're doing but is happening within the google sign in libraries and horologist.
I think that's the cause of some of the issues I've seen (and why I found them so hard to reproduce). I've done an update in 519a189 that avoids that issue (and also fixes #993 by allowing the user to select a different account if they want when they sign back in). When the user selects an account, we get a fresh idToken.
You nailed it! 🌟 🌟 🌟 I was able to switch between Google accounts today.
I've noticed that when I change my emulator to have a slow internet connection, the refresh sometimes takes extremely long (as in, multiple minutes). It's weird because as I slow down the emulator, everything seems to work fine, and then suddenly there's a huge drop off in the speed once I slow it down past a certain point. I'm not sure what's going on there either, but just sharing in case it gives you any hints as you test further.
I think that might have been the issue. So that I got a better load and refresh performance, I tested the PR on a release apk and things were so much smoother.
By now, I have tested it multiple times and it behaved correctly each time. I also smoke-tested phone app with different account types and it also worked correctly. Code changes look good as well. With this, I'm approving the PR.
Description
This prevents users from accessing the wear app if they are not Plus users since v1 of the wear app will not have control-the-phone-app-from-the-watch-app functionality for free users.
Getting this working well turned out to be more difficult than I expected. In particular, getting the "logging in" screen to show and block the user until the refresh was complete was the tricky part. I'm mentioning this just to call out that this PR probably merits some extra testing.
A couple of issues you may see:
Testing Instructions
For each of the following scenarios:
Verify that:
In addition, also test that we are handling accounts that change from Plus to Free appropriately:
RequirePlusScreen
Phone app
Because I made a small change to how we report a user's subscription status, it would be good to do some smoke-testing around logging into and out of some Plus and Free accounts on the phone app.
Screenshots or Screencast
Screen.Recording.2023-05-24.at.9.17.11.PM.mov
Screen.Recording.2023-05-24.at.9.38.14.PM.mov
Checklist
modules/services/localization/src/main/res/values/strings.xml
I have tested any UI changes...