Skip to content

[PM-38978] fix: Hide Plan settings row for organization-only premium users#2783

Merged
matt-livefront merged 1 commit into
mainfrom
matt/PM-38978-hide-premium-org-users
Jun 12, 2026
Merged

[PM-38978] fix: Hide Plan settings row for organization-only premium users#2783
matt-livefront merged 1 commit into
mainfrom
matt/PM-38978-hide-premium-org-users

Conversation

@matt-livefront

@matt-livefront matt-livefront commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

🎟️ 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 returns true for 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 updates SettingsProcessor to hide the Plan row when premium comes only from an organization (hasPremium && !hasPremiumPersonally).

Behavior after this change:

  • Organization-only premium: Plan row hidden (no error path).
  • Personal premium: Plan row shown → manage subscription (unchanged).
  • No premium (free): Plan row shown → upgrade path (unchanged).

@matt-livefront matt-livefront requested a review from a team as a code owner June 12, 2026 19:21
@matt-livefront matt-livefront added ai-review Request a Claude code review t:bug Change Type - Bug labels Jun 12, 2026
@github-actions github-actions Bot added the app:password-manager Bitwarden Password Manager app context label Jun 12, 2026
@github-actions

github-actions Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

🤖 Bitwarden Claude Code Review

Overall 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 StateService.doesActiveAccountHavePremiumPersonally() and uses it in SettingsProcessor to gate showPlanRow, preventing navigation to a personal subscription screen that would error for these users. Mock, service, and processor tests were updated and added to cover the new branch and the existing show/hide paths.

Code Review Details

No findings.

The implementation follows the existing doesActiveAccountHavePremium() pattern (same error logging, same default-on-error of false), the new boolean (hasPremiumFromOrganizationOnly) is well-named with an inline comment explaining the rationale, and the new mock default (true) is consistent with the sibling mock so pre-existing tests continue to behave correctly. Test coverage includes personal-true, personal-false with org premium, personal-nil, and the no-account error path on the service side, plus an org-only hide-plan-row test on the processor side.

@codecov

codecov Bot commented Jun 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.91%. Comparing base (1372c15) to head (9fbe57c).
⚠️ Report is 1 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@matt-livefront matt-livefront merged commit 0d96dd7 into main Jun 12, 2026
24 of 29 checks passed
@matt-livefront matt-livefront deleted the matt/PM-38978-hide-premium-org-users branch June 12, 2026 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-review Request a Claude code review app:password-manager Bitwarden Password Manager app context t:bug Change Type - Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants