Skip to content

Ac/pm 38906 decrypt list with failures for collections - #1253

Draft
JaredScar wants to merge 5 commits into
mainfrom
ac/pm-38906-decrypt-list-with-failures-for-collections
Draft

Ac/pm 38906 decrypt list with failures for collections#1253
JaredScar wants to merge 5 commits into
mainfrom
ac/pm-38906-decrypt-list-with-failures-for-collections

Conversation

@JaredScar

Copy link
Copy Markdown
Contributor

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-38906

📔 Objective

Utilize SDK for decryption and utilize decryptMany methods so only 1 SDK call is used

JaredScar added 4 commits July 9, 2026 15:58
- Added `DecryptCollectionListResult` struct to encapsulate successful and failed decryption results of collections.
- Introduced `decrypt_list_with_failures` method in `CollectionsClient` to return both successfully decrypted collections and those that failed, improving error handling during decryption.
- Updated `Collection` struct to derive `Clone` for better usability in collection operations.
- Introduced three new test cases for the `decrypt_list_with_failures` method in the `CollectionsClient`.
- The tests cover scenarios for all successful decryption, mixed results with one failure, and an empty collection list.
- These additions enhance the test coverage for error handling during collection decryption, ensuring robustness in the implementation.
…bitwarden-vault`

- Implemented tests to compare the performance of sequential versus bulk decryption methods in both `KeyStore` and `CollectionsClient`.
- The tests measure the time taken to decrypt a list of items/collections, asserting correctness while providing speedup metrics.
- These additions enhance performance evaluation capabilities for decryption processes, ensuring efficient handling of large datasets.
@JaredScar JaredScar added the ai-review Request a Claude code review label Jul 10, 2026
@github-actions

github-actions Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

🤖 Bitwarden Claude Code Review

Overall Assessment: APPROVE

Reviewed the addition of decrypt_list_with_failures for collections across bitwarden-vault, its UniFFI binding, and the Clone derive on Collection. The implementation faithfully mirrors the already-established cipher pattern (DecryptCipherListResult), delegating to the shared KeyStore::decrypt_list_with_failures so a single failing item no longer aborts the whole batch. Tests cover all-success, mixed, and empty-list cases, and correctly assert that failed items are returned unchanged as ciphertext.

Code Review Details

No blocking findings.

Minor consistency notes (not flagged as inline comments): the new DecryptCollectionListResult omits #[serde(rename_all = "camelCase")], deny_unknown_fields, and the Debug derive that its sibling DecryptCipherListResult carries. These have no functional impact here — the struct's own field names (successes, failures) are single lowercase words, and nested types carry their own serde attributes — so they are left to author discretion.

Comment thread crates/bitwarden-crypto/src/store/mod.rs Outdated
Comment thread crates/bitwarden-vault/src/collection_client.rs Outdated
@github-actions

github-actions Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

🔍 SDK Breaking Change Detection

SDK Version: ac/pm-38906-decrypt-list-with-failures-for-collections (c3d13eb)

⚠️ If breaking changes are detected, a corresponding pull request addressing them must be ready for merge in the affected client repository.

Client Status Details
typescript ✅ No breaking changes detected Compilation passed with new SDK version - View Details
android ❌ Breaking changes detected Compilation failed with new SDK version. A corresponding pull request addressing the breaking changes must be ready for merge in bitwarden/android. - View Details

Breaking change detection uses the build of the SDK from this branch, including any incompatibities pre-existing on or merged into this branch. Check the workflow logs to confirm.
Results update as workflows complete.

@codecov

codecov Bot commented Jul 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.67925% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.49%. Comparing base (3ba312f) to head (4cf2f6e).
⚠️ Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
crates/bitwarden-uniffi/src/vault/collections.rs 0.00% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1253      +/-   ##
==========================================
+ Coverage   85.09%   85.49%   +0.39%     
==========================================
  Files         477      482       +5     
  Lines       65934    67393    +1459     
==========================================
+ Hits        56109    57620    +1511     
+ Misses       9825     9773      -52     

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread crates/bitwarden-crypto/src/store/mod.rs Outdated
Comment thread crates/bitwarden-vault/src/collection_client.rs
…rypto` and `bitwarden-vault`

- Deleted the speed comparison tests that evaluated the performance of sequential versus bulk decryption methods in both `KeyStore` and `CollectionsClient`.
- This cleanup reduces code clutter and focuses on maintaining essential test cases for decryption functionality.
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 breaking-change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants