Skip to content

[PM-40139] feat: Consolidate Disable Send and Send Options into Send Controls policy#2877

Draft
matt-livefront wants to merge 1 commit into
matt/PM-40133-send-controls-policyfrom
matt/PM-40139-send-controls-policy-consolidation
Draft

[PM-40139] feat: Consolidate Disable Send and Send Options into Send Controls policy#2877
matt-livefront wants to merge 1 commit into
matt/PM-40133-send-controls-policyfrom
matt/PM-40139-send-controls-policy-consolidation

Conversation

@matt-livefront

@matt-livefront matt-livefront commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

🎟️ Tracking

PM-40139

📔 Objective

Note

Depends on #2868

Consolidates the two existing Send policies (Disable Send and Send Options) into the new Send Controls policy.

  • Consolidates the two Send restriction behaviors behind the pm-31885-send-controls feature flag, completing the enforcement work deferred by PM-38792 (which added the policy type, SDK mapping, and flag plumbing).
  • When the flag is on, "Sends disabled" and "hide-email disabled" are read from the new sendControls org policy (type 21) data — data["disableSend"] and data["disableHideEmail"]. When off, the app keeps respecting the legacy disableSend (type 6, presence-based) and sendOptions (type 7, disableHideEmail) policies unchanged.
  • Adds PolicyOptionType.disableSend; centralizes the flag branch in PolicyService (isSendDisabledByPolicy() new, isSendHideEmailDisabledByPolicy() updated) so the four UI-layer call sites (AddEditSendItemProcessor, SendListProcessor, TabCoordinator ×2) stay thin service calls with no flag logic.

@matt-livefront matt-livefront added ai-review Request a Claude code review t:feature labels Jul 10, 2026
@github-actions github-actions Bot added the app:password-manager Bitwarden Password Manager app context label Jul 10, 2026
@github-actions

github-actions Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

🤖 Bitwarden Claude Code Review

Overall Assessment: APPROVE

Reviewed the consolidation of the legacy Disable Send (type 6) and Send Options (type 7) policies into the new Send Controls policy (type 21) behind the pm-31885-send-controls feature flag. The flag branching is centralized in PolicyService.isSendDisabledByPolicy() and isSendHideEmailDisabledByPolicy(), keeping the four UI call sites (AddEditSendItemProcessor, SendListProcessor, TabCoordinator ×2) as thin service calls. Verified that all referenced types (PolicyType.sendControls, PolicyOptionType.disableSend), the feature flag, and the boolValue accessor resolve correctly, and that no stray legacy policy call sites remain.

Code Review Details

No findings. The change is well-scoped and the test coverage is thorough — both flag-on and flag-off branches are exercised for send-disabled and hide-email-disabled paths, including no-data, no-policies, and cross-policy-ignore cases. Backward compatibility with the legacy policies is preserved when the flag is off.

Note: this PR targets the stacked base branch matt/PM-40133-send-controls-policy rather than main, consistent with the dependency noted in the description (#2868).

@codecov

codecov Bot commented Jul 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.26%. Comparing base (5d839bd) to head (473e7a6).

Additional details and impacted files
@@                          Coverage Diff                           @@
##           matt/PM-40133-send-controls-policy    #2877      +/-   ##
======================================================================
+ Coverage                               78.98%   81.26%   +2.28%     
======================================================================
  Files                                    1150     1027     -123     
  Lines                                   73426    66143    -7283     
======================================================================
- Hits                                    57993    53753    -4240     
+ Misses                                  15433    12390    -3043     

☔ 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.

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:feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant