[PR #6978] [MERGED] [PM-37232] fix: Hide upgrade CTAs while a Premium upgrade is pending #107231

Closed
opened 2026-06-03 13:45:01 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/6978
Author: @SaintPatrck
Created: 5/26/2026
Status: Merged
Merged: 5/27/2026
Merged by: @SaintPatrck

Base: mainHead: premium-upgrade/hide-upgrade-cta-when-upgrade-is-pending


📝 Commits (9)

  • a925110 fix: Hide upgrade CTAs while a Premium upgrade is pending
  • 504c400 Trim KDocs on Premium upgrade pending additions to contract-only
  • 6aa1b0b Stop clearing the pending flag when the user dismisses the dialog
  • 281f214 Address review feedback on isPremiumUpgradePendingFlow and PlanScreen comment
  • 285e3da Project Premium upgrade state as a sealed UpgradeLifecycleState
  • e784beb Use null to clear the pending flag, matching SettingsDiskSource convention
  • 30d97b8 Drop preemptive MaxLineLength suppressions on Premium upgrade pending tests
  • 394a818 Rename lifecycleStateFlow to upgradeLifecycleStateFlow
  • 3b18251 Rename LifecycleStateReceive action to UpgradeLifecycleStateReceive

📊 Changes

12 files changed (+554 additions, -37 deletions)

View changed files

📝 app/src/main/kotlin/com/x8bit/bitwarden/data/billing/manager/PremiumStateManager.kt (+12 -0)
📝 app/src/main/kotlin/com/x8bit/bitwarden/data/billing/manager/PremiumStateManagerImpl.kt (+74 -6)
app/src/main/kotlin/com/x8bit/bitwarden/data/billing/repository/model/UpgradeLifecycleState.kt (+33 -0)
📝 app/src/main/kotlin/com/x8bit/bitwarden/data/platform/datasource/disk/SettingsDiskSource.kt (+19 -0)
📝 app/src/main/kotlin/com/x8bit/bitwarden/data/platform/datasource/disk/SettingsDiskSourceImpl.kt (+34 -1)
📝 app/src/main/kotlin/com/x8bit/bitwarden/ui/platform/feature/premium/plan/PlanScreen.kt (+41 -27)
📝 app/src/main/kotlin/com/x8bit/bitwarden/ui/platform/feature/premium/plan/PlanViewModel.kt (+48 -2)
📝 app/src/test/kotlin/com/x8bit/bitwarden/data/billing/manager/PremiumStateManagerTest.kt (+120 -0)
📝 app/src/test/kotlin/com/x8bit/bitwarden/data/platform/datasource/disk/SettingsDiskSourceTest.kt (+71 -0)
📝 app/src/test/kotlin/com/x8bit/bitwarden/data/platform/datasource/disk/util/FakeSettingsDiskSource.kt (+30 -0)
📝 app/src/test/kotlin/com/x8bit/bitwarden/ui/platform/feature/premium/plan/PlanScreenTest.kt (+1 -0)
📝 app/src/test/kotlin/com/x8bit/bitwarden/ui/platform/feature/premium/plan/PlanViewModelTest.kt (+71 -1)

📄 Description

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-37232

📔 Objective

When a user completes Stripe checkout and returns to the app, the server-side subscription confirmation can lag the client. During that window the Vault home upgrade banner and the Plan screen Upgrade Now button kept advertising the upgrade we were already processing, which nudged users to start the checkout flow a second time.

Promote the "PendingUpgrade" signal from transient PlanViewModel state to a per-user disk-backed flag exposed via PremiumStateManager. The banner-eligibility flow now gates on it, the Plan screen hides its Upgrade Now CTA while it is set, and the flag clears when the server flips the active user to Premium. Dismissing the PendingUpgrade dialog is a UI-only action and leaves the pending state intact, so CTAs stay suppressed until the upgrade actually resolves.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/bitwarden/android/pull/6978 **Author:** [@SaintPatrck](https://github.com/SaintPatrck) **Created:** 5/26/2026 **Status:** ✅ Merged **Merged:** 5/27/2026 **Merged by:** [@SaintPatrck](https://github.com/SaintPatrck) **Base:** `main` ← **Head:** `premium-upgrade/hide-upgrade-cta-when-upgrade-is-pending` --- ### 📝 Commits (9) - [`a925110`](https://github.com/bitwarden/android/commit/a92511018b5f536d94cfebb36935ad4a9354a916) fix: Hide upgrade CTAs while a Premium upgrade is pending - [`504c400`](https://github.com/bitwarden/android/commit/504c400822b90773d154b4c006b33af0c269cd8f) Trim KDocs on Premium upgrade pending additions to contract-only - [`6aa1b0b`](https://github.com/bitwarden/android/commit/6aa1b0b25ad1181bb1b3ec3ef958e3a13b2fdf7a) Stop clearing the pending flag when the user dismisses the dialog - [`281f214`](https://github.com/bitwarden/android/commit/281f2145b5de384cfa5347edb08d7de77c05ae03) Address review feedback on isPremiumUpgradePendingFlow and PlanScreen comment - [`285e3da`](https://github.com/bitwarden/android/commit/285e3da89c11e8f4335cbe10bf4ad82b09becddb) Project Premium upgrade state as a sealed UpgradeLifecycleState - [`e784beb`](https://github.com/bitwarden/android/commit/e784bebf407fc19422f859a387258344007e61b8) Use null to clear the pending flag, matching SettingsDiskSource convention - [`30d97b8`](https://github.com/bitwarden/android/commit/30d97b8199eff7a90adc634fa8a25b8683bf0697) Drop preemptive MaxLineLength suppressions on Premium upgrade pending tests - [`394a818`](https://github.com/bitwarden/android/commit/394a8186c98bfa180da5de3cc004e4a2b70aaa65) Rename lifecycleStateFlow to upgradeLifecycleStateFlow - [`3b18251`](https://github.com/bitwarden/android/commit/3b182513f52d8897b8569c762c2569d318c0c1f4) Rename LifecycleStateReceive action to UpgradeLifecycleStateReceive ### 📊 Changes **12 files changed** (+554 additions, -37 deletions) <details> <summary>View changed files</summary> 📝 `app/src/main/kotlin/com/x8bit/bitwarden/data/billing/manager/PremiumStateManager.kt` (+12 -0) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/data/billing/manager/PremiumStateManagerImpl.kt` (+74 -6) ➕ `app/src/main/kotlin/com/x8bit/bitwarden/data/billing/repository/model/UpgradeLifecycleState.kt` (+33 -0) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/data/platform/datasource/disk/SettingsDiskSource.kt` (+19 -0) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/data/platform/datasource/disk/SettingsDiskSourceImpl.kt` (+34 -1) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/ui/platform/feature/premium/plan/PlanScreen.kt` (+41 -27) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/ui/platform/feature/premium/plan/PlanViewModel.kt` (+48 -2) 📝 `app/src/test/kotlin/com/x8bit/bitwarden/data/billing/manager/PremiumStateManagerTest.kt` (+120 -0) 📝 `app/src/test/kotlin/com/x8bit/bitwarden/data/platform/datasource/disk/SettingsDiskSourceTest.kt` (+71 -0) 📝 `app/src/test/kotlin/com/x8bit/bitwarden/data/platform/datasource/disk/util/FakeSettingsDiskSource.kt` (+30 -0) 📝 `app/src/test/kotlin/com/x8bit/bitwarden/ui/platform/feature/premium/plan/PlanScreenTest.kt` (+1 -0) 📝 `app/src/test/kotlin/com/x8bit/bitwarden/ui/platform/feature/premium/plan/PlanViewModelTest.kt` (+71 -1) </details> ### 📄 Description ## 🎟️ Tracking https://bitwarden.atlassian.net/browse/PM-37232 ## 📔 Objective When a user completes Stripe checkout and returns to the app, the server-side subscription confirmation can lag the client. During that window the Vault home upgrade banner and the Plan screen Upgrade Now button kept advertising the upgrade we were already processing, which nudged users to start the checkout flow a second time. Promote the "PendingUpgrade" signal from transient `PlanViewModel` state to a per-user disk-backed flag exposed via `PremiumStateManager`. The banner-eligibility flow now gates on it, the Plan screen hides its Upgrade Now CTA while it is set, and the flag clears when the server flips the active user to Premium. Dismissing the PendingUpgrade dialog is a UI-only action and leaves the pending state intact, so CTAs stay suppressed until the upgrade actually resolves. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-06-03 13:45:01 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/android#107231