Skip to content

[PM-35680] chore: Remove unused MockSdkCipherRepository#2805

Open
matt-livefront wants to merge 1 commit into
mainfrom
matt/PM-35680-sdk-mocks-cipher-repo
Open

[PM-35680] chore: Remove unused MockSdkCipherRepository#2805
matt-livefront wants to merge 1 commit into
mainfrom
matt/PM-35680-sdk-mocks-cipher-repo

Conversation

@matt-livefront

@matt-livefront matt-livefront commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

🎟️ Tracking

PM-35680

📔 Objective

Removes the bespoke MockSdkCipherRepository test helper, which is dead code.

It was introduced in #1738 (PM-13607, SDK client-managed state registration) and used in exactly one place — ClientServiceTests stubbed sdkRepositoryFactory.makeCipherRepositoryReturnValue = MockSdkCipherRepository().

In #2584 (SDK update to 2.0.0-4880) the SDK factory API changed from makeCipherRepository() -> CipherRepository to makeRepositories() -> Repositories (a struct bundling all client-managed repos). That PR rewrote the test to use makeRepositoriesReturnValue = BitwardenSdk.Repositories(cipher: nil, ...), which removed the mock's only reference — but the file itself was left behind.

There is no longer any consumer for the mock, and there isn't a natural one: the app only ever produces a CipherRepository (via SdkRepositoryFactory, handed to the SDK) — it never injects one into a unit under test, which is the only scenario a mock would serve. The two tests that touch ciphers don't need it:

  • ClientServiceTests.test_client_registersClientManagedRepositories passes cipher: nil and only asserts the factory was called.
  • SdkRepositoryFactoryTests.test_makeRepositories asserts the factory returns the real SdkCipherRepository, so it can't use a mock.

Rather than convert the mock to Sourcery AutoMockable, it's deleted outright to drop the maintenance surface.

@matt-livefront matt-livefront requested a review from a team as a code owner June 17, 2026 21:47
@github-actions github-actions Bot added app:password-manager Bitwarden Password Manager app context t:tech-debt Change Type - Tech debt labels Jun 17, 2026
@github-actions

github-actions Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

🤖 Bitwarden Claude Code Review

Overall Assessment: APPROVE

This PR deletes the unused MockSdkCipherRepository.swift test helper (57 lines). I verified the codebase contains zero remaining references to MockSdkCipherRepository and that no project configuration (xcodegen YAML / pbxproj) references the file. The PR description accurately documents the file's history and why it is now dead code.

Code Review Details

No findings. Clean, well-scoped dead-code removal with an accurate description.

@codecov

codecov Bot commented Jun 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.83%. Comparing base (f5067ec) to head (c1d4459).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2805      +/-   ##
==========================================
+ Coverage   80.80%   80.83%   +0.02%     
==========================================
  Files        1019     1019              
  Lines       64849    64849              
==========================================
+ Hits        52402    52418      +16     
+ Misses      12447    12431      -16     

☔ 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app:password-manager Bitwarden Password Manager app context t:tech-debt Change Type - Tech debt

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant