Skip to content

fix: delete recordings instead of proxy rules in DELETE recordings/:id - #243

Merged
alexliesenfeld merged 4 commits into
httpmock:masterfrom
danieleades:fix/delete-recording-endpoint
Aug 31, 2026
Merged

alexliesenfeld merged 4 commits into
httpmock:masterfrom
danieleades:fix/delete-recording-endpoint

Conversation

@danieleades

@danieleades danieleades commented Jul 11, 2026 •

Copy link
Copy Markdown
Contributor

Problem

handle_delete_recording (the handler behind DELETE /__httpmock__/recordings/:id) called state.delete_proxy_rule(...) instead of delete_recording(...) — an apparent copy-paste slip. Deleting a recording via the admin API silently removed a proxy rule with the same id (or returned 404 based on proxy-rule existence), and the recording itself was never deleted. StateManager::delete_recording was unreachable from the server.

Fix

  • Call delete_recording in handle_delete_recording (src/server/handler.rs).
  • Fix the copy-pasted tracing messages in the forwarding-rule and recording deletion paths in src/server/state.rs (they all said "proxy rule").

Behaviour change

The endpoint now actually deletes the recording and returns 204/404 based on whether the recording exists.

Verification

Adds a regression test that connects to the standalone server (so the deletion goes through the HTTP admin handler), creates a recording, and deletes it — it fails with a 404 panic against the previous handler and passes with the fix.

Full cargo test --all-features suite passes locally (122 unit, 137 integration, 138 doc tests).

@codecov

codecov Bot commented Jul 11, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@danieleades
danieleades force-pushed the fix/delete-recording-endpoint branch 3 times, most recently from d925384 to 0f3ab94 Compare August 10, 2026 10:24
@danieleades
danieleades force-pushed the fix/delete-recording-endpoint branch 4 times, most recently from 89d6120 to 704a1f8 Compare August 16, 2026 12:32
handle_delete_recording called state.delete_proxy_rule, so deleting a
recording via the admin API removed a proxy rule instead. Also fix
copy-pasted log messages in the forwarding-rule and recording deletion
paths.
The regression test connects to the standalone server so the deletion
goes through the HTTP handler; it fails against the previous handler
(404) and passes with the fix.
Covers the remaining changed lines: the forwarding-rule deletion log
path and the 404 branches for deleting unknown forwarding-rule and
recording ids through the admin API.
@danieleades
danieleades force-pushed the fix/delete-recording-endpoint branch from 704a1f8 to 16aeea4 Compare August 17, 2026 18:51
@alexliesenfeld
alexliesenfeld merged commit 6364aff into httpmock:master Aug 31, 2026
12 checks passed
@alexliesenfeld

alexliesenfeld commented Aug 31, 2026 •

Copy link
Copy Markdown
Member

Thanks!

@danieleades
danieleades deleted the fix/delete-recording-endpoint branch August 31, 2026 07:15
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.

2 participants