Skip to content

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

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 to SubscriptionsManager.switchSubscriptionPlan with computed Google Play SubscriptionReplacementMode (within-tier switch, prorated upgrade, deferred downgrade).

Extends subscription responses/storage to include BE-provided pendingPlans: introduces PendingPlan domain + datastore JSON persistence, parses pending plans on purchase confirmation and refreshSubscriptionData, and adds derived Subscription.effectiveTier/hasPendingChange. The settings UI now optionally shows a pending change hint (gated by new showPendingPlanHint toggle), 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.

@cmonfortep
Copy link
Contributor Author

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
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 2 potential issues.

android:layout_height="6dp"
android:layout_marginStart="@dimen/keyline_3"
android:layout_marginEnd="@dimen/keyline_2"
android:layout_gravity="center_vertical"/>
Copy link

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.

Fix in Cursor Fix in Web

suspend fun getLocalPurchasedAt(): Long?
suspend fun removeLocalPurchasedAt()
suspend fun setPendingPlans(pendingPlans: List<PendingPlan>)
suspend fun getPendingPlans(): List<PendingPlan>
Copy link

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.

Additional Locations (2)

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