-
Notifications
You must be signed in to change notification settings - Fork 1.5k
[PM-29045] Fix deletion of ciphers after their collections are deleted #6851
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
When a cipher's collection is deleted, the cipher becomes orphaned and cannot be permanently deleted. Changed DeleteAdmin to use GetByIdAsyncAdmin to bypass collection-based filtering, consistent with other admin endpoints.
This commit introduces a new test class for the CiphersController, implementing integration tests to verify the behavior of cipher deletion and restoration when associated collections are deleted. The tests ensure that orphaned ciphers can be deleted and restored correctly, maintaining data integrity across multiple collections.
|
Great job! No new security vulnerabilities introduced in this pull request |
…c for repository calls Updated tests in CiphersControllerTests to replace GetByIdAsync with GetOrganizationDetailsByIdAsync for fetching cipher details. Adjusted assertions in delete and restore admin methods to ensure correct organization context is maintained. This change enhances clarity and consistency in the test suite.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6851 +/- ##
==========================================
- Coverage 59.90% 56.17% -3.73%
==========================================
Files 1966 1966
Lines 86883 86883
Branches 7741 7741
==========================================
- Hits 52046 48810 -3236
- Misses 32954 36255 +3301
+ Partials 1883 1818 -65 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
jaasen-livefront
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Thanks for the tests!

🎟️ Tracking
https://bitwarden.atlassian.net/browse/PM-29045
📔 Objective
Fixes a bug where ciphers cannot be permanently deleted from trash after their collections are deleted.
Changed
DeleteAdminto useGetByIdAsyncAdmin()which bypasses collection filtering, matching the behavior ofPutDeleteAdminandPutRestoreAdmin.📸 Screenshots
⏰ Reminders before review
🦮 Reviewer guidelines
:+1:) or similar for great changes:memo:) or ℹ️ (:information_source:) for notes or general info:question:) for questions:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion:art:) for suggestions / improvements:x:) or:warning:) for more significant problems or concerns needing attention:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt:pick:) for minor or nitpick changes