Skip to content

Support switching subscription tier plans#7652

Open
cmonfortep wants to merge 3 commits intofeature/cristian/subscription/support_new_tierfrom
feature/cristian/subscription/support_switching_plans
Open

Support switching subscription tier plans#7652
cmonfortep wants to merge 3 commits intofeature/cristian/subscription/support_new_tierfrom
feature/cristian/subscription/support_switching_plans

Conversation

@cmonfortep
Copy link
Contributor

@cmonfortep cmonfortep commented Feb 3, 2026

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

Before After
!(Upload before screenshot) (Upload after screenshot)

Note

Medium Risk
Touches subscription purchase/switch flows and persistent subscription state (new pendingPlans storage), which could affect billing behavior and UI messaging if parsing/mapping is incorrect; changes are localized and covered by added tests.

Overview
Enables tier/plan switching from the subscriptions web flow by adding a new JS message (subscriptionChangeSelected) that maps requested plan changes to the appropriate Google Play SubscriptionReplacementMode (upgrade prorated, downgrade deferred, within-tier without proration) and routes the command through SubscriptionsWebViewActivity into SubscriptionsManager.switchSubscriptionPlan.

Extends subscription data handling to include server-provided pendingPlans: adds PendingPlan domain/DTOs, persists them in SubscriptionsDataStore (JSON via Moshi), populates them on purchase confirmation and refreshSubscriptionData, and exposes UI-facing helpers like Subscription.hasPendingChange / effectiveTier. A new privacyPro.showPendingPlanHint toggle gates showing a pending upgrade/downgrade hint in Subscription Settings.

Updates tier purchase surface details: adds Pro free-trial offer IDs and combines free-trial offer lists, adjusts upgradeToProUrl query params, refines Subscription Settings UI (replaces tier pill drawables with text label, limits “switch plan” to Plus/Google), and tweaks a few subscription/feedback strings.

Written by Cursor Bugbot for commit 3413456. This will update automatically on new commits. Configure here.

@cmonfortep
Copy link
Contributor Author

cmonfortep commented Feb 3, 2026

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.
Learn more

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

@cmonfortep cmonfortep requested review from lmac012 and removed request for malmstein and mikescamell February 3, 2026 12:46
@cmonfortep cmonfortep force-pushed the feature/cristian/subscription/support_switching_plans branch from bf132e8 to a20118d Compare February 3, 2026 14:53
SubscriptionTier.PRO -> "Pro"
SubscriptionTier.UNKNOWN -> "Plus" // fallback
}
val periodName = if (billingPeriod.equals("monthly", ignoreCase = true)) "Monthly" else "Yearly"
Copy link
Contributor

Choose a reason for hiding this comment

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

We're missing translations here

Comment on lines 98 to 102
val type = when (subscription.productId) {
MONTHLY_PLAN_US, MONTHLY_PLAN_ROW -> Monthly
else -> Yearly
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This has to be updated to use subscription.billingPeriod. New plan ids are now mapped to yearly, which leads to incorrect copy being shown on settings screen.

@cmonfortep cmonfortep force-pushed the feature/cristian/subscription/support_new_tier branch from 5880409 to 80fa88f Compare February 6, 2026 14:28
@cmonfortep cmonfortep force-pushed the feature/cristian/subscription/support_switching_plans branch from a20118d to 3413456 Compare February 6, 2026 14:28
Copy link

@cursor cursor bot left a 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 1 potential issue.

null
}

// Use firstOrNull() for UI display
Copy link

Choose a reason for hiding this comment

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

Monthly Pro plans incorrectly detected as Yearly duration

High Severity

The type (duration) detection at line 99 only checks for Plus monthly plan IDs (MONTHLY_PLAN_US, MONTHLY_PLAN_ROW). Pro monthly plan IDs like MONTHLY_PRO_PLAN_US fall through to the else -> Yearly branch. This causes monthly Pro subscribers to see yearly renewal copy on the settings screen. It also feeds an incorrect currentDuration into isPendingPlanDowngrade, potentially mislabeling tier changes as upgrades or downgrades. This was flagged by a reviewer as needing to use subscription.billingPeriod instead.


Please tell me if this was useful or not with a 👍 or 👎.

Additional Locations (1)

Fix in Cursor Fix in Web

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.

2 participants