domain: Webmention and WebmentionEndpoint types exist only for a test mock #68

Open
opened 2026-07-03 01:43:17 +00:00 by rosa · 1 comment
Owner

Found during a code review of the domain crate.

Location: crates/domain/src/models/webmention.rs:178 (Webmention, WebmentionEndpoint)
Type: Cleanup — dead-in-production types

Problem

Webmention and WebmentionEndpoint have no production consumers; they are constructed only by the feature-gated test mock NoOpWebmentionsClient, which hardcodes a fake endpoint, and asserted in services tests against that same constant. The infra webmention job works with raw URLs and never touches either type.

Cost

Two public domain types (plus DomainError::WebmentionEndpointUrlInvalid and its web mapping) are maintained solely so a mock can record calls.

Suggested fix

Have the mock store the SendWebmentionRequests it receives (as it already does for verifications) and delete Webmention and WebmentionEndpoint.

Found during a code review of the `domain` crate. **Location:** `crates/domain/src/models/webmention.rs:178` (`Webmention`, `WebmentionEndpoint`) **Type:** Cleanup — dead-in-production types ## Problem `Webmention` and `WebmentionEndpoint` have no production consumers; they are constructed only by the feature-gated test mock `NoOpWebmentionsClient`, which hardcodes a fake endpoint, and asserted in services tests against that same constant. The infra webmention job works with raw URLs and never touches either type. ## Cost Two public domain types (plus `DomainError::WebmentionEndpointUrlInvalid` and its web mapping) are maintained solely so a mock can record calls. ## Suggested fix Have the mock store the `SendWebmentionRequest`s it receives (as it already does for verifications) and delete `Webmention` and `WebmentionEndpoint`.
Author
Owner

Triage: confirmed. Webmention/WebmentionEndpoint (crates/domain/src/models/webmention.rs) are constructed only by the test mock NoOpWebmentionsClient; the WebmentionClient port and the infra job never touch them. Cleanup is self-contained: record SendWebmentionRequests in the mock, then delete both types, DomainError::WebmentionEndpointUrlInvalid, and its web error mapping.

Triage: confirmed. `Webmention`/`WebmentionEndpoint` (crates/domain/src/models/webmention.rs) are constructed only by the test mock `NoOpWebmentionsClient`; the `WebmentionClient` port and the infra job never touch them. Cleanup is self-contained: record `SendWebmentionRequest`s in the mock, then delete both types, `DomainError::WebmentionEndpointUrlInvalid`, and its web error mapping.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
rosa/vernier#68
No description provided.