Skip to content

PM-30774: Add archiving and unarchiving network requests#6356

Merged
david-livefront merged 1 commit intomainfrom
PM-30774-archive-network-requests
Jan 14, 2026
Merged

PM-30774: Add archiving and unarchiving network requests#6356
david-livefront merged 1 commit intomainfrom
PM-30774-archive-network-requests

Conversation

@david-livefront
Copy link
Collaborator

@david-livefront david-livefront commented Jan 13, 2026

🎟️ Tracking

PM-30774

📔 Objective

This PR adds the data layer functionality for archiving and unarchiving a cipher.

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team

🦮 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

@david-livefront david-livefront marked this pull request as ready for review January 13, 2026 21:42
@david-livefront david-livefront requested a review from a team as a code owner January 13, 2026 21:42
@github-actions github-actions bot added app:password-manager Bitwarden Password Manager app context app:authenticator Bitwarden Authenticator app context t:misc Change Type - ¯\_(ツ)_/¯ labels Jan 13, 2026
@david-livefront david-livefront added the ai-review Request a Claude code review label Jan 13, 2026
@claude
Copy link
Contributor

claude bot commented Jan 13, 2026

Claude finished @david-livefront's task in 3m 9s —— View job


Code Review Complete

Overall Assessment: REQUEST CHANGES

Summary:
This PR adds archive/unarchive functionality at the data layer following established patterns. The implementation correctly mirrors the softDeleteCipher pattern, uses proper Result types, and includes comprehensive test coverage. However, both unarchiveCipher tests have incorrect mock expectations that need correction.

Issues Found:

⚠️ IMPORTANT (1 issue, 2 occurrences):

  • Test bug: unarchiveCipher tests mock archivedDate = fixedInstant when implementation sets archivedDate = null
    • CipherManagerTest.kt:896 and :953

Review Details:

Architecture & Patterns:

  • Follows established CipherManager patterns (mirrors softDeleteCipher/restoreCipher)
  • Correct Result type usage with sealed classes
  • Proper module organization (app for manager, network for API/service)
  • Error handling follows project standards

Implementation:

  • Archive operation correctly sets archivedDate = clock.instant()
  • Unarchive operation correctly sets archivedDate = null
  • Encryption flow follows encrypt→API→decrypt→re-encrypt pattern
  • Migration scenarios handled properly

Test Coverage:

  • Comprehensive scenarios: no user, API failure, success, migration
  • Network layer tests verify API calls correctly
  • Archive tests are correct and match implementation

⚠️ Fix Required:
Both unarchiveCipher tests need mock expectations corrected to verify actual behavior (see inline comments).


See inline comments for specific fixes needed.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 13, 2026

Logo
Checkmarx One – Scan Summary & Detailse34329ec-1af2-4699-9be4-6292bc2d8e13

New Issues (2)

Checkmarx found the following issues in this Pull Request

# Severity Issue Source File / Package Checkmarx Insight
1 MEDIUM Use_of_Hardcoded_Password /network/src/test/kotlin/com/bitwarden/network/service/CiphersServiceTest.kt: 70
detailsThe application uses the hard-coded password "cipherId" for authentication purposes, either using it to verify users' identities, or to access ano...
Attack Vector
2 MEDIUM Use_of_Hardcoded_Password /network/src/test/kotlin/com/bitwarden/network/service/CiphersServiceTest.kt: 78
detailsThe application uses the hard-coded password "cipherId" for authentication purposes, either using it to verify users' identities, or to access ano...
Attack Vector

@david-livefront david-livefront force-pushed the PM-30774-archive-network-requests branch from 08b510f to 6b90362 Compare January 13, 2026 21:52
@github-actions github-actions bot removed the ai-review Request a Claude code review label Jan 13, 2026
@codecov
Copy link

codecov bot commented Jan 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.48%. Comparing base (f6edc19) to head (6b90362).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6356      +/-   ##
==========================================
+ Coverage   85.47%   85.48%   +0.01%     
==========================================
  Files         764      764              
  Lines       54742    54790      +48     
  Branches     7896     7902       +6     
==========================================
+ Hits        46788    46836      +48     
  Misses       5211     5211              
  Partials     2743     2743              

☔ View full report in Codecov by Sentry.
📢 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.

@david-livefront
Copy link
Collaborator Author

Thanks @SaintPatrck

@david-livefront david-livefront added this pull request to the merge queue Jan 14, 2026
Merged via the queue into main with commit a9b1623 Jan 14, 2026
16 checks passed
@david-livefront david-livefront deleted the PM-30774-archive-network-requests branch January 14, 2026 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app:authenticator Bitwarden Authenticator app context app:password-manager Bitwarden Password Manager app context t:misc Change Type - ¯\_(ツ)_/¯

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants