Skip to content

Conversation

@david-livefront
Copy link
Collaborator

@david-livefront david-livefront commented Nov 5, 2025

🎟️ Tracking

PM-27846

📔 Objective

This PR moves the DispatcherManager from the data module to the core module.

⏰ 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

@claude
Copy link
Contributor

claude bot commented Nov 5, 2025

Claude finished @david-livefront's task —— View job


PR Review: Move DispatcherManager to core module

Tasks

  • Analyze PR changes and architecture impact
  • Check for correct import path updates
  • Verify module dependencies and build configuration
  • Review test fixture configuration
  • Create inline comments for specific issues
  • Provide overall assessment

Summary

This PR successfully moves DispatcherManager from the data module to the core module. The refactoring is clean, consistent, and architecturally sound.

Key Changes

Module Structure

  • DispatcherManager interface and DispatcherManagerImpl moved to core/src/main/kotlin/com/bitwarden/core/data/manager/dispatcher/
  • DispatcherManagerTest moved to core/src/test/kotlin/com/bitwarden/core/data/manager/dispatcher/
  • FakeDispatcherManager moved to core/src/testFixtures/kotlin/com/bitwarden/core/data/manager/dispatcher/

Build Configuration

  • core/build.gradle.kts: Added testFixtures support with proper dependencies (core/build.gradle.kts:38-40)
  • data/build.gradle.kts: Already has proper core dependency and testFixtures configuration (data/build.gradle.kts:60)
  • app/build.gradle.kts: Added testFixtures dependency for core module (app/build.gradle.kts:284)
  • authenticator/build.gradle.kts: Added testFixtures dependency for core module (authenticator/build.gradle.kts:231)

Import Updates

  • All 100+ files consistently updated from com.x8bit.bitwarden.data.platform.manager.dispatcher.* (app) or com.bitwarden.data.manager.* (data/authenticator) to com.bitwarden.core.data.manager.dispatcher.*
  • The previously identified import issue in ServerConfigRepositoryTest.kt has been fixed (data/src/test/kotlin/com/bitwarden/data/repository/ServerConfigRepositoryTest.kt:4)

No Regressions

  • No old import paths remain in the codebase
  • Original dispatcher files properly removed from data module
  • All Hilt DI modules properly updated

Architecture Assessment

This move is architecturally appropriate for several reasons:

  1. Proper Layering: DispatcherManager is a foundational utility used across multiple modules (:app, :authenticator, :data). Placing it in :core follows the principle of locating shared infrastructure in the lowest common module.

  2. Dependency Flow: The change maintains proper dependency direction - higher-level modules (:app, :authenticator, :data) depend on :core, not vice versa.

  3. Test Infrastructure: Moving FakeDispatcherManager to core/testFixtures allows it to be shared across all modules that need it, promoting code reuse and consistency in testing.

  4. Consistency: The new package structure com.bitwarden.core.data.manager.dispatcher follows the established naming conventions in the core module.

Code Quality

  • Consistency: All 114 changed files follow identical import update patterns
  • Completeness: Both production and test code properly updated
  • Clean Diff: No extraneous changes beyond the necessary import updates and module structure

Previous Review Status

The critical issue identified in the previous review has been resolved:

  • ServerConfigRepositoryTest.kt now correctly imports FakeDispatcherManager from com.bitwarden.core.data.manager.dispatcher instead of the old data module path

Recommendation

APPROVED

This is a well-executed refactoring that improves the codebase structure by moving a foundational utility to its proper architectural location. The changes are mechanical, consistent, and complete.

No issues found. Ready to merge once CI passes.


@github-actions
Copy link
Contributor

github-actions bot commented Nov 5, 2025

Logo
Checkmarx One – Scan Summary & Detailsae1cdf17-5778-4b62-b4b4-aed2b35a804f

Great job! No new security vulnerabilities introduced in this pull request

@david-livefront david-livefront force-pushed the PM-27846-core-dispatcher-manager branch from eec55b8 to ae82bf6 Compare November 5, 2025 17:22

import app.cash.turbine.test
import com.bitwarden.core.data.util.asSuccess
import com.bitwarden.data.datasource.disk.base.FakeDispatcherManager
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incorrect import path for FakeDispatcherManager

This import is still referencing the old path in the data module. It should be updated to use the new path in the core module:

Suggested change
import com.bitwarden.data.datasource.disk.base.FakeDispatcherManager
import com.bitwarden.core.data.manager.dispatcher.FakeDispatcherManager

Since FakeDispatcherManager has been moved to core/src/testFixtures/kotlin/com/bitwarden/core/data/manager/dispatcher/FakeDispatcherManager.kt, this import needs to be updated to match the new package structure.

@david-livefront david-livefront force-pushed the PM-27846-core-dispatcher-manager branch from ae82bf6 to 3a22dff Compare November 5, 2025 17:28
@codecov
Copy link

codecov bot commented Nov 5, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.96%. Comparing base (510072b) to head (3a22dff).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6124   +/-   ##
=======================================
  Coverage   84.96%   84.96%           
=======================================
  Files         724      724           
  Lines       52758    52758           
  Branches     7659     7659           
=======================================
  Hits        44826    44826           
  Misses       5249     5249           
  Partials     2683     2683           

☔ 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 Nov 5, 2025
Merged via the queue into main with commit aceb96d Nov 5, 2025
13 checks passed
@david-livefront david-livefront deleted the PM-27846-core-dispatcher-manager branch November 5, 2025 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants