Remove two interview routes nothing calls
Problem and behavior
#582 asked for a review of the API endpoints and the removal of any that serve
no purpose. Two have no caller outside their own tests:
| Endpoint | Callers | What still covers it |
|---|---|---|
GET /api/interviews/{id}/snapshot | none; added for a late-joining reader that was never written | GET /api/recordings/{id}/events and the template's GET /api/recording/replay serve the same replay_snapshot |
POST /api/interviews/{id}/end | none; meant for the browser on unload, never sent by any page | the room_finished webhook and the egress_ended that carries the file, which also covers a lost room_finished; a lost egress_ended leaves the row to the sweeper |
After this change both paths fall through to the static fallback, as any
unknown /api/ path already does. The one read lost is the replay of an
interview whose recording never started, which nothing requested.
Every other endpoint has a caller:
- Pages and scripts: token, token/release, task-sets (unlock, task, attempts),
task-reviews, observer-token, login (GET link, POST form), session, github
device and poll, logout, update, interviews, consent, recording (GET and
POST), events, recordings (list, detail, events), reports (GET, POST, both
DELETEs), setup and setup/offer, runtime-config.js. - Outside services:
/api/callback(GitHub OAuth redirect) and
/api/recording/webhook(LiveKit). /healthzhas only test callers. It stays: only the full app answers it, the
setup server does not, and a deployment's health check would use it./api/peer/*: every sub-route is called fromweb/peer-*.jsexcept
POST /api/peer/sessions/{id}/terminate. It ends a running session and keeps
what was finished, and no page offers that yet. I kept it; should it go too,
or is a page for it planned?
Approach
Delete both handlers, their route entries, their tests and the contract text
that described them. replay_snapshot and finish_recording stay because the
other routes and the webhook use them.
The removed snapshot test was the only one reaching three answers of the shared
replay_response. The expired 410 now has a test on the template route. The
deleted 410 is reachable only when a deletion lands between the history
route's check and its read, so it and the quotaExceeded field get unit tests
on replay_response in tests/unit/web.rs. The contract keeps the body shape
and its Ending section names both webhooks.
Validation
./scripts/test.sh rust on this head, in a Linux arm64 container, passed:
test result: ok. 12 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
skipping cargo-deny: `cargo install cargo-deny` checks dependency licenses and sources
The deleted-410 and quotaExceeded mutations of replay_response each fail
the new unit tests, and pass every other suite.
./scripts/test.sh browser on macOS: 3555 passed, 33 skipped, 2 failed, neither
touched by this diff. media-probe fails the same way on main here
(receiver-stats-unavailable), and the strict-selection cached-attempt test
passed three of three runs alone.
Not run: cargo-deny.
Summary by cubic
Removes the two interview API routes nothing calls, so unknown /api/ paths uniformly fall through to the static fallback.
GET /api/interviews/{id}/snapshotwas added for a late-joining reader that was never written; the same read stays onGET /api/recordings/{id}/eventsand the template's replay read.POST /api/interviews/{id}/endwas meant for browser unload but no page sends it; recordings still end via theroom_finishedwebhook, thenegress_ended, then the sweeper.
The only read lost is the replay of an interview whose recording never started, which nothing requested. The removed snapshot test was the only coverage of the expired, deleted, and quota-exceeded replay answers; expired coverage moves to the template route, and deleted plus quota-exceeded get unit tests on replay_response. Refs #582.