domain: Webmention and WebmentionEndpoint types exist only for a test mock #68
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
rosa/vernier#68
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found during a code review of the
domaincrate.Location:
crates/domain/src/models/webmention.rs:178(Webmention,WebmentionEndpoint)Type: Cleanup — dead-in-production types
Problem
WebmentionandWebmentionEndpointhave no production consumers; they are constructed only by the feature-gated test mockNoOpWebmentionsClient, 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::WebmentionEndpointUrlInvalidand 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 deleteWebmentionandWebmentionEndpoint.Triage: confirmed.
Webmention/WebmentionEndpoint(crates/domain/src/models/webmention.rs) are constructed only by the test mockNoOpWebmentionsClient; theWebmentionClientport and the infra job never touch them. Cleanup is self-contained: recordSendWebmentionRequests in the mock, then delete both types,DomainError::WebmentionEndpointUrlInvalid, and its web error mapping.