Skip to content

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

Open
matt-livefront wants to merge 3 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 3 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

Re-reviewed the Send Controls deletionHours enforcement after the latest push: SendPolicyOptions.enforcedDeletionDateHours (minimum hours across applying policies), the new SendDeletionDateType.fourteenDays case with from(hours:) preset mapping and custom fallback, and the add/edit Send wiring (state helpers, loadData, disabled menu with policy helper text). The enforcement stays gated behind PolicyService.getSendPolicyOptions()'s sendControls feature flag, and AnyCodable.intValue tolerates int/double/string encodings from the server. The previously flagged removePassword gap is now addressed: the enforced date is applied only to new Sends (state.mode != .edit), with the rationale documented in both loadData() and removePassword() and covered by tests for edit mode and the password-removal path. Menu rendering is safe when the enforced hours fall outside the preset list, since BitwardenMenuField labels from selection.localizedName rather than the options array, and the field is disabled in that state.

Code Review Details

No findings at or above the reporting threshold.

@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 79.60%. Comparing base (064586b) to head (c20ec85).

Additional details and impacted files
@@                                Coverage Diff                                 @@
##           matt/PM-40460-send-controls-restrict-send-type    #2910      +/-   ##
==================================================================================
- Coverage                                           79.60%   79.60%   -0.01%     
==================================================================================
  Files                                                1169     1169              
  Lines                                               75224    75261      +37     
==================================================================================
+ Hits                                                59884    59913      +29     
- Misses                                              15340    15348       +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 force-pushed the matt/PM-38792-send-controls-restrict-deletion-days branch from 4a790d9 to e6e82db Compare August 21, 2026 19:46

@fedemkr fedemkr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just a ⛏️

"NewSendCreated" = "Send created";
"Custom" = "Custom";
"SendDisabledWarning" = "Due to an enterprise policy, you are only able to delete an existing Send.";
"SendDeletionDateEnforcedByOrganization" = "This date is enforced by your organization";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⛏️ Can't we use the key made from the value? ThisDateIsEnforcedByYourOrganization

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, good catch!

@matt-livefront
matt-livefront force-pushed the matt/PM-38792-send-controls-restrict-deletion-days branch from e6e82db to 61dc7db Compare August 24, 2026 19:51
@matt-livefront
matt-livefront force-pushed the matt/PM-38792-send-controls-restrict-deletion-days branch from 61dc7db to df6fa3f Compare August 31, 2026 18:59
@matt-livefront
matt-livefront requested a review from fedemkr August 31, 2026 21:40
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.

2 participants