-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Support switching subscription tier plans #7652
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
base: feature/cristian/subscription/support_new_tier
Are you sure you want to change the base?
Support switching subscription tier plans #7652
Conversation
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
...ons-impl/src/main/java/com/duckduckgo/subscriptions/impl/ui/SubscriptionSettingsViewModel.kt
Show resolved
Hide resolved
...ions-impl/src/main/java/com/duckduckgo/subscriptions/impl/ui/SubscriptionSettingsActivity.kt
Show resolved
Hide resolved
bf132e8 to
a20118d
Compare
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.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
| android:layout_height="6dp" | ||
| android:layout_marginStart="@dimen/keyline_3" | ||
| android:layout_marginEnd="@dimen/keyline_2" | ||
| android:layout_gravity="center_vertical"/> |
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.
Vertical divider always visible when tier name hidden
Medium Severity
The newly added VerticalDivider within subscriptionActiveStatusContainer has no visibility control. It will remain visible even when tierName is hidden (when isProTierEnabled is false or when tier is UNKNOWN). This results in a UI glitch where a vertical divider appears with nothing after it. The divider needs an ID and visibility control synchronized with tierName, or both elements need to be wrapped in a container that can be controlled together.
| suspend fun getLocalPurchasedAt(): Long? | ||
| suspend fun removeLocalPurchasedAt() | ||
| suspend fun setPendingPlans(pendingPlans: List<PendingPlan>) | ||
| suspend fun getPendingPlans(): List<PendingPlan> |
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.
Unused standalone pending plans methods in repository
Low Severity
The setPendingPlans and getPendingPlans methods are added to the AuthRepository interface and implemented in RealAuthRepository, but they're never called from any production code. Pending plans storage and retrieval is already handled through setSubscription and getSubscription, which include the pending plans as part of the Subscription object. These standalone methods are dead code that adds unnecessary interface surface area.



Task/Issue URL: https://app.asana.com/1/137249556945/project/72649045549333/task/1213036807834788?focus=true
Description
Adds logic to support tier switching plans, and FE integration
Steps to test this PR
See Asana task: https://app.asana.com/1/137249556945/project/72649045549333/task/1213073996670202?focus=true
UI changes
Note
High Risk
Touches subscription purchase/switch flows and persistence by adding tier-switch replacement modes and storing BE-provided
pendingPlans, which could affect billing state and what users see as their active/effective plan.Overview
Adds support for switching between subscription tiers from the web-based subscriptions flow by accepting a new JS message (
subscriptionChangeSelected) and routing it through toSubscriptionsManager.switchSubscriptionPlanwith computed Google PlaySubscriptionReplacementMode(within-tier switch, prorated upgrade, deferred downgrade).Extends subscription responses/storage to include BE-provided
pendingPlans: introducesPendingPlandomain + datastore JSON persistence, parses pending plans on purchase confirmation andrefreshSubscriptionData, and adds derivedSubscription.effectiveTier/hasPendingChange. The settings UI now optionally shows a pending change hint (gated by newshowPendingPlanHinttoggle), and replaces tier “pill” drawables with a text tier label.Updates offer constants to include Pro free-trial offer IDs (and combines them with Plus), and adjusts FE URLs/JS tier options generation accordingly; adds/updates tests for pending plan storage and Pro free-trial tier options.
Written by Cursor Bugbot for commit a20118d. This will update automatically on new commits. Configure here.