[PM-38324] Optimize DeleteSendsJob - #8282
Conversation
🤖 Bitwarden Claude Code ReviewOverall Assessment: APPROVE Reviewed the chunked Findings from earlier review rounds were re-verified at |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #8282 +/- ##
==========================================
+ Coverage 63.66% 69.40% +5.73%
==========================================
Files 2430 2467 +37
Lines 104962 105801 +839
Branches 9506 9560 +54
==========================================
+ Hits 66822 73429 +6607
+ Misses 35844 29936 -5908
- Partials 2296 2436 +140 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…:bitwarden/server into tools/PM-38324-optimize-delete-sends-job merge main
🎟️ Tracking
https://bitwarden.atlassian.net/browse/PM-38324
📔 Objective
During resolution of bitwarden/clients#16965 DbOps suggested a few improvements to the
DeleteSendsJob.Chunked fetch — add to Send_ReadByDeletionDateBefore and loop in the job so one run can't pull an unbounded backlog into memory + a tight delete loop.
Set-based Send_DeleteMany — delete the batch in one statement and bump each affected user once (collapsing N bumps ~distinct-user count), instead of N separate Send_DeleteById calls.
Optionally throttle between batches so a backlog drain spreads out rather than saturating the Hyperscale log.