Skip to content

[PM-38792] feat: Enforce Send deletion date via Send Controls policy - #2910

Open
matt-livefront wants to merge 6 commits into
matt/PM-40460-send-controls-restrict-send-typefrom
matt/PM-38792-send-controls-restrict-deletion-days
Open

[PM-38792] feat: Enforce Send deletion date via Send Controls policy#2910
matt-livefront wants to merge 6 commits into
matt/PM-40460-send-controls-restrict-send-typefrom
matt/PM-38792-send-controls-restrict-deletion-days

Conversation

@matt-livefront

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

Copy link
Copy Markdown
Collaborator

🎟️ Tracking

PM-38792

📔 Objective

Adds enforcement of the new Send Controls policy deletionHours option. When an organization restricts the Send deletion date, a non-owner/non-admin user sees the enforced deletion date pre-selected and locked on the Send add/edit screen, with helper text explaining the restriction. Also adds the previously-missing 14 days deletion option to the menu.

📸 Screenshots

Screenshot 2026-07-24 at 12 18 27 PM

@matt-livefront
matt-livefront requested a review from a team as a code owner July 24, 2026 19:04
@matt-livefront matt-livefront added ai-review Request a Claude code review t:feature labels Jul 24, 2026
@github-actions github-actions Bot added app:password-manager Bitwarden Password Manager app context app:authenticator Bitwarden Authenticator app context labels Jul 24, 2026
@github-actions

github-actions Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

🤖 Bitwarden Claude Code Review

Overall Assessment: APPROVE

Reviewed the enforcement of the Send Controls deletionHours policy across the domain model (SendPolicyOptions), the SendDeletionDateType enum (new fourteenDays case plus from(hours:) mapping), and the add/edit Send screen (state, processor, and view). The implementation mirrors the existing enforcedAccessType pattern, resolves the most restrictive (minimum hours) deletion date across multiple policies, and disables the menu with helper text when enforced. Test coverage is thorough across all layers, including preset mapping, custom fallback, multi-policy resolution, and view enabled/disabled state.

Code Review Details

No blocking findings.

Notes considered and cleared during review:

  • In edit mode loadData overrides the loaded Send's deletion date with the policy-enforced date — this is intentional and consistent with how enforcedAccessType is applied.
  • A policy-enforced non-preset value produces a .custom date not present in availableDeletionDateTypes for .add mode, but BitwardenMenuField renders selection.localizedName directly and the field is disabled, so the value still displays correctly.
  • intValue on AnyCodable robustly handles int/double/string server encodings for deletionHours.

@codecov

codecov Bot commented Jul 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.88%. Comparing base (091707b) to head (4a790d9).

Additional details and impacted files
@@                                Coverage Diff                                 @@
##           matt/PM-40460-send-controls-restrict-send-type    #2910      +/-   ##
==================================================================================
- Coverage                                           81.11%   78.88%   -2.24%     
==================================================================================
  Files                                                1039     1162     +123     
  Lines                                               67387    74715    +7328     
==================================================================================
+ Hits                                                54662    58939    +4277     
- Misses                                              12725    15776    +3051     

☔ 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:authenticator Bitwarden Authenticator app context 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