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

Update Settings: Address Ppro Issues #5460

Merged
merged 14 commits into from
Jan 14, 2025

Conversation

mikescamell
Copy link
Contributor

@mikescamell mikescamell commented Jan 13, 2025

Task/Issue URL: https://app.asana.com/0/1207908166761516/1209138029097313/f

Description

Address Ship Review comments regarding not being able to see Ppro settings items when subscriptions expired.

It was necessary to consider available Products (you may see these referred to as "features" internally in the subscription module) when a user's subscription has expired or they are in a waiting state, as their entitlements would end up being empty.

Now we know what Products are available to the user, we can display them correctly in their disabled state to match the new Settings design.

Steps to test this PR

Prerequisite: newSettings feature flag is enabled

Follow these instructions to install Play Billing Lab so you can test US and ROW subscription plans

US

Prerequisite: Country/Region is set to US in Play Billing Lab

New Settings Top Level

  • Open Settings screen
  • Verify items displayed match design Not Subscribed state

Subscribed State

  • Tap "Get Privacy Pro"
  • Purchase Ppro monthly
  • One Purchase is completed return to top level settings screen
  • Verify VPN, PIR, ITR and Settings items are displayed, matching design Subscribed state
  • Turn on VPN
  • Return to top level settings screen
  • Ensure VPN status indicator is on
  • Turn VPN off
  • Return to top level settings screen
  • Ensure VPN status is off

Expired State

  • Tap "Subscription Settings"
  • Click "Update Plan or Cancel" item
  • Cancel the Subscription
  • Wait 5 mins
  • Return to top level settings screen
  • Verify VPN, PIR, ITR are in a disabled state like designs
  • Verify VPN, PIR, ITR are not clickable
  • Verify Settings item is in expired state

Remove subscription

  • Re-purchase Ppro
  • From the Subscription Settings screen click "Remove From this Device"
  • Return to top level settings screen
  • Verify you're in the Not Subscribed state

Activating State

Prerequisite: Apply patch in task as this is hard to reproduce via device

  • Apply patch
  • Open settings
  • Verify Ppro is in Activating state like designs
  • Verify VPN, PIR, ITR are not clickable
  • Re-purchase Ppro
  • From the Subscription Settings screen click "Remove From this Device"
  • Return to top level settings screen
  • Verify you're in the Not Subscribed state

ROW

Prerequisite: Country/Region is set to UK in Play Billing Lab

New Settings Top Level

  • Open Settings screen
  • Verify items displayed match design Not Subscribed state

Subscribed State

  • Tap "Get Privacy Pro"
  • Purchase Ppro monthly
  • One Purchase is completed return to top level settings screen
  • Verify only VPN, ITR and Settings items are displayed and match design Subscribed state
  • Turn on VPN
  • Return to top level settings screen
  • Ensure VPN status indicator is on
  • Turn VPN off
  • Return to top level settings screen
  • Ensure VPN status is off

Expired State

  • Tap "Subscription Settings"
  • Click "Update Plan or Cancel" item
  • Cancel the Subscription
  • Wait 5 mins
  • Return to top level settings screen
  • Verify only VPN, ITR are in a disabled state like designs
  • Verify VPN, ITR are not clickable
  • Verify Settings item is in expired state

Remove subscription

  • Re-purchase Ppro
  • From the Subscription Settings screen click "Remove From this Device"
  • Return to top level settings screen
  • Verify you're in the Not Subscribed state

UI changes

No UI changes but it's helpful to see the designs to remember our new states

Copy link
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

We need these in the netp module

ideally all feature Strings would be a Product when getting them from the DataStore but that is too many changes for this task
we'll do everything in the NetP ViewModel so we can put this back to how it was prior to changes for the new settings screen
moving handleRevokedVPNState just to ensure we're disabling the VPN as we don't use NetworkProtectionAccessState in the new settings flow, which in the legacy world would take care of this

we allow the clickListener to be set to null to stop click handling if states happen to change while on the settings screen, I've forgotten why setting clickable to false is not enough
Now we're handling this in the VM it's no longer needed
we were missing making settings visible in some cases, which is prominent when doing the subscription flows on device rather than just switching states and launching the app via IDE
@mikescamell mikescamell force-pushed the feature/mike/update-settings/vpn-fixes branch from 7f405c6 to ae1e2c2 Compare January 13, 2025 13:28
@mikescamell mikescamell marked this pull request as ready for review January 13, 2025 14:24
val subscription = authRepository.getSubscription()

return if(subscription != null) {
authRepository.getFeatures(subscription.productId)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we shouldn't ignore the existing kill switch for features api - see how it is used in getSubscriptionOffer() method. Maybe we can extract that logic from there.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lmac012 changes made here: e61c867 (#5460)

Copy link
Contributor

@malmstein malmstein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

works as expected, nice work @mikescamell !

@mikescamell mikescamell merged commit 019e7fb into develop Jan 14, 2025
8 checks passed
@mikescamell mikescamell deleted the feature/mike/update-settings/vpn-fixes branch January 14, 2025 11:10
0nko pushed a commit that referenced this pull request Jan 27, 2025
Task/Issue URL:
https://app.asana.com/0/1207908166761516/1209138029097313/f

### Description

Address Ship Review comments regarding not being able to see Ppro
settings items when subscriptions expired.

It was necessary to consider available Products ([you may see these
referred to as "features" internally in the subscription
module](https://app.asana.com/0/414730916066338/1209117572597478/f))
when a user's subscription has expired or they are in a waiting state,
as their entitlements would end up being empty.

Now we know what Products are available to the user, we can display them
correctly in their disabled state to match the new Settings design.

### Steps to test this PR

Prerequisite: `newSettings` feature flag is enabled

Follow these
[instructions](https://app.asana.com/0/1142021229838617/1208861246073828/f)
to install Play Billing Lab so you can test US and ROW subscription
plans

**US**

Prerequisite: Country/Region is set to US in Play Billing Lab 

_New Settings Top Level_
- [x] Open Settings screen 
- [x] Verify items displayed match design Not Subscribed state

_Subscribed State_
- [ ] Tap "Get Privacy Pro"
- [ ] Purchase Ppro monthly
- [ ] One Purchase is completed return to top level settings screen
- [ ] Verify VPN, PIR, ITR and Settings items are displayed, matching
design Subscribed state
- [ ] Turn on VPN
- [ ] Return to top level settings screen
- [ ] Ensure VPN status indicator is on
- [ ] Turn VPN off
- [ ] Return to top level settings screen
- [ ] Ensure VPN status is off

_Expired State_
- [ ] Tap "Subscription Settings"
- [ ] Click "Update Plan or Cancel" item
- [ ] Cancel the Subscription
- [ ] Wait 5 mins
- [ ] Return to top level settings screen
- [ ] Verify VPN, PIR, ITR are in a disabled state like designs
- [ ] Verify VPN, PIR, ITR are not clickable
- [ ] Verify Settings item is in expired state 

_Remove subscription_
- [ ] Re-purchase Ppro
- [ ] From the Subscription Settings screen click "Remove From this
Device"
- [ ] Return to top level settings screen
- [ ] Verify you're in the Not Subscribed state

_Activating State_

Prerequisite: Apply patch in
[task](https://app.asana.com/0/1207908166761516/1209138029097313/f) as
this is hard to reproduce via device

- [ ] Apply patch
- [ ] Open settings
- [ ] Verify Ppro is in Activating state like designs
- [ ] Verify VPN, PIR, ITR are not clickable
- [ ] Re-purchase Ppro
- [ ] From the Subscription Settings screen click "Remove From this
Device"
- [ ] Return to top level settings screen
- [ ] Verify you're in the Not Subscribed state

**ROW**

Prerequisite: Country/Region is set to UK in Play Billing Lab 

_New Settings Top Level_
- [ ] Open Settings screen 
- [ ] Verify items displayed match design Not Subscribed state

_Subscribed State_
- [ ] Tap "Get Privacy Pro"
- [ ] Purchase Ppro monthly
- [ ] One Purchase is completed return to top level settings screen
- [ ] Verify only VPN, ITR and Settings items are displayed and match
design Subscribed state
- [ ] Turn on VPN
- [ ] Return to top level settings screen
- [ ] Ensure VPN status indicator is on
- [ ] Turn VPN off
- [ ] Return to top level settings screen
- [ ] Ensure VPN status is off

_Expired State_
- [ ] Tap "Subscription Settings"
- [ ] Click "Update Plan or Cancel" item
- [ ] Cancel the Subscription
- [ ] Wait 5 mins
- [ ] Return to top level settings screen
- [ ] Verify only VPN, ITR are in a disabled state like designs
- [ ] Verify VPN, ITR are not clickable
- [ ] Verify Settings item is in expired state 

_Remove subscription_
- [ ] Re-purchase Ppro
- [ ] From the Subscription Settings screen click "Remove From this
Device"
- [ ] Return to top level settings screen
- [ ] Verify you're in the Not Subscribed state

### UI changes

No UI changes but it's helpful to see the
[designs](https://www.figma.com/design/CjH849hL53lhsPlf6Ufeo4/%E2%9A%99%EF%B8%8F-Browser-Settings-Documentation-(All-Platforms)?node-id=7605-431390&t=RdmuNULWUyR1cMH7-4)
to remember our new states
0nko pushed a commit that referenced this pull request Jan 27, 2025
Task/Issue URL:
https://app.asana.com/0/1207908166761516/1209138029097313/f

Address Ship Review comments regarding not being able to see Ppro
settings items when subscriptions expired.

It was necessary to consider available Products ([you may see these
referred to as "features" internally in the subscription
module](https://app.asana.com/0/414730916066338/1209117572597478/f))
when a user's subscription has expired or they are in a waiting state,
as their entitlements would end up being empty.

Now we know what Products are available to the user, we can display them
correctly in their disabled state to match the new Settings design.

Prerequisite: `newSettings` feature flag is enabled

Follow these
[instructions](https://app.asana.com/0/1142021229838617/1208861246073828/f)
to install Play Billing Lab so you can test US and ROW subscription
plans

**US**

Prerequisite: Country/Region is set to US in Play Billing Lab

_New Settings Top Level_
- [x] Open Settings screen
- [x] Verify items displayed match design Not Subscribed state

_Subscribed State_
- [ ] Tap "Get Privacy Pro"
- [ ] Purchase Ppro monthly
- [ ] One Purchase is completed return to top level settings screen
- [ ] Verify VPN, PIR, ITR and Settings items are displayed, matching
design Subscribed state
- [ ] Turn on VPN
- [ ] Return to top level settings screen
- [ ] Ensure VPN status indicator is on
- [ ] Turn VPN off
- [ ] Return to top level settings screen
- [ ] Ensure VPN status is off

_Expired State_
- [ ] Tap "Subscription Settings"
- [ ] Click "Update Plan or Cancel" item
- [ ] Cancel the Subscription
- [ ] Wait 5 mins
- [ ] Return to top level settings screen
- [ ] Verify VPN, PIR, ITR are in a disabled state like designs
- [ ] Verify VPN, PIR, ITR are not clickable
- [ ] Verify Settings item is in expired state

_Remove subscription_
- [ ] Re-purchase Ppro
- [ ] From the Subscription Settings screen click "Remove From this
Device"
- [ ] Return to top level settings screen
- [ ] Verify you're in the Not Subscribed state

_Activating State_

Prerequisite: Apply patch in
[task](https://app.asana.com/0/1207908166761516/1209138029097313/f) as
this is hard to reproduce via device

- [ ] Apply patch
- [ ] Open settings
- [ ] Verify Ppro is in Activating state like designs
- [ ] Verify VPN, PIR, ITR are not clickable
- [ ] Re-purchase Ppro
- [ ] From the Subscription Settings screen click "Remove From this
Device"
- [ ] Return to top level settings screen
- [ ] Verify you're in the Not Subscribed state

**ROW**

Prerequisite: Country/Region is set to UK in Play Billing Lab

_New Settings Top Level_
- [ ] Open Settings screen
- [ ] Verify items displayed match design Not Subscribed state

_Subscribed State_
- [ ] Tap "Get Privacy Pro"
- [ ] Purchase Ppro monthly
- [ ] One Purchase is completed return to top level settings screen
- [ ] Verify only VPN, ITR and Settings items are displayed and match
design Subscribed state
- [ ] Turn on VPN
- [ ] Return to top level settings screen
- [ ] Ensure VPN status indicator is on
- [ ] Turn VPN off
- [ ] Return to top level settings screen
- [ ] Ensure VPN status is off

_Expired State_
- [ ] Tap "Subscription Settings"
- [ ] Click "Update Plan or Cancel" item
- [ ] Cancel the Subscription
- [ ] Wait 5 mins
- [ ] Return to top level settings screen
- [ ] Verify only VPN, ITR are in a disabled state like designs
- [ ] Verify VPN, ITR are not clickable
- [ ] Verify Settings item is in expired state

_Remove subscription_
- [ ] Re-purchase Ppro
- [ ] From the Subscription Settings screen click "Remove From this
Device"
- [ ] Return to top level settings screen
- [ ] Verify you're in the Not Subscribed state

No UI changes but it's helpful to see the
[designs](https://www.figma.com/design/CjH849hL53lhsPlf6Ufeo4/%E2%9A%99%EF%B8%8F-Browser-Settings-Documentation-(All-Platforms)?node-id=7605-431390&t=RdmuNULWUyR1cMH7-4)
to remember our new states
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 this pull request may close these issues.

3 participants