Skip to content

Untangle layering: move fragment_packet from app to dedicated module #431

@coderabbitai

Description

@coderabbitai

Context

Related to PR #424 which demonstrates the pattern for modularisation by refactoring the connection module.

Request from: @leynos
Source: #424

Objective

Untangle layering violation where fragment_packet is under app but used by the connection actor. Move it to a non-app module and re-export from app if needed to preserve the old path.

Current situation

  • fragment_packet is defined in src/app/fragment_utils.rs:1
  • Used by connection actor at src/connection.rs:52 and src/connection.rs:662
  • This creates a layering violation where the connection module depends on app-specific utilities

Proposed solution

  • Move fragment_packet to a non-app module (e.g., src/fragment/packet.rs)
  • Re-export from app to preserve the old public API path if needed
  • Update imports in src/connection.rs to reference the new location

Approach

Follow the pattern established in PR #424:

  • Extract the functionality into a dedicated module
  • Maintain public API compatibility through re-exports where appropriate
  • Ensure all tests continue to pass after refactoring

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions