[PM-38978] fix: Hide Plan settings row for organization-only premium users#2783
Conversation
🤖 Bitwarden Claude Code ReviewOverall Assessment: APPROVE Reviewed a focused bugfix that hides the Settings → Plan row for users whose premium is granted only by an organization. The change introduces Code Review DetailsNo findings. The implementation follows the existing |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2783 +/- ##
=======================================
Coverage 87.90% 87.91%
=======================================
Files 1719 1719
Lines 167804 167850 +46
=======================================
+ Hits 147507 147561 +54
+ Misses 20297 20289 -8 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
🎟️ Tracking
PM-38978
📔 Objective
Users whose premium is granted only by their organization (e.g. an Enterprise plan) could tap Settings → Plan and hit an error. The Plan screen is for managing or upgrading a personal subscription, which these users don't have.
The root cause is that the Settings screen relied on
doesActiveAccountHavePremium(), which returnstruefor premium obtained either personally or through an organization.navigateToPlan()then routed these users to.premiumPlan(nil)(the personal-subscription management screen) with no personal subscription to display.This change adds
StateService.doesActiveAccountHavePremiumPersonally()to distinguish personally-purchased premium from organization-granted premium, and updatesSettingsProcessorto hide the Plan row when premium comes only from an organization (hasPremium && !hasPremiumPersonally).Behavior after this change: