[PM-32699] Utilize cache to check ability of useMyItems if available#7922
[PM-32699] Utilize cache to check ability of useMyItems if available#7922JaredScar wants to merge 2 commits into
Conversation
…ization ability cache - Added IOrganizationAbilityCacheService to the constructor for improved performance. - Replaced direct organization repository calls with cache lookups in UpsertDefaultCollectionsForUsersAsync. - Introduced OrganizationUsesMyItemsAsync method to streamline cache access and fallback logic. - Updated tests to accommodate the new cache service and ensure correct behavior under various scenarios.
🤖 Bitwarden Claude Code ReviewOverall Assessment: APPROVE Reviewed the refactor of Code Review DetailsNo blocking findings.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7922 +/- ##
==========================================
- Coverage 61.35% 61.33% -0.03%
==========================================
Files 2236 2242 +6
Lines 98547 98633 +86
Branches 8911 8911
==========================================
+ Hits 60468 60493 +25
- Misses 35943 36004 +61
Partials 2136 2136 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
… handling and remove organization repository dependency - Removed IOrganizationRepository from the constructor and refactored OrganizationUsesMyItemsAsync to throw NotFoundException when the organization is not found in the ability cache. - Updated tests to reflect changes in exception handling and removed unnecessary organization repository calls.
🎟️ Tracking
https://bitwarden.atlassian.net/browse/PM-32699
📔 Objective
Uses useMyItems flag from cache if available, otherwise if null/miss, falls back to checking on the Organization model