Repository navigation
Conversation
c1d3a61 to
36dad77
Compare
GET /api/interviews/{id}/snapshot and POST /api/interviews/{id}/end have
no caller outside their own tests; web/, desktop/ and the scripts never
request either. The snapshot route was added for a late-joining reader
that was never written. The same read is still served by
GET /api/recordings/{id}/events and the template's replay read, so the
only thing lost is reading the replay of an interview whose recording
never started, which nothing did. The end route was meant to be sent by
the browser on unload, but no page ever sent it, so a recording ends on
the room_finished webhook and the egress_ended that carries its file,
which also covers a lost room_finished; a lost egress_ended leaves the
row to the sweeper.
Delete both handlers, their route entries, their tests and the contract
text that described them. The snapshot section keeps its reasoning and
the body shape both remaining routes answer with, and Ending names the
two webhooks. replay_snapshot and finish_recording stay, because the
other routes and the webhook still use them.
The removed snapshot test was the only one that reached three answers
of the shared replay response. The expired answer gets a test on the
template route. The deleted answer is reached only by a deletion that
lands between the history route's check and its read, and quotaExceeded
in the body was asserted nowhere else, so both get a unit test on
replay_response itself.
Change-Id: Ic1b1b82e19cb28707bf75310a5a05e01e3321cc5
36dad77 to
51f0b76
Compare
| /// One answer for every replay read, so the two routes that take one cannot | ||
| /// drift apart. | ||
| /// | ||
| /// They differ in two things and this takes both: what "no such replay" means | ||
| /// to the caller, which is a recording id to one route and a room to another, | ||
| /// and the sentence a read error is logged under. Everything else was written | ||
| /// out three times, including the two `410` bodies, and those are the retention | ||
| /// promise: a copy that said something slightly different would be a third | ||
| /// out twice, including the two `410` bodies, and those are the retention | ||
| /// promise: a copy that said something slightly different would be a second | ||
| /// answer to a question the product gives one answer to. `gone_response` below | ||
| /// exists for the same reason on the route ahead of this one. | ||
| /// | ||
| /// A function pointer rather than a closure, because none of the three captures | ||
| /// A function pointer rather than a closure, because neither route captures | ||
| /// anything: what a route answers here is a constant, and a signature that | ||
| /// allowed a captured one would be inviting a fourth thing to differ. | ||
| /// allowed a captured one would be inviting a third thing to differ. |
There was a problem hiding this comment.
"Everything else was written out three times" was history and stayed true when the snapshot route went (d446fa1e folded three copies), so "twice" makes it false. The present-tense counts ("the two routes", "neither route", "a third thing") are the shape docs/development.md (Comments that count things) warns about, and this PR is where the last one went stale; naming the routes keeps the comment true, and the new comment in replay_view ("Both routes that read a replay") can name them the same way.
| /// One answer for every replay read, so the two routes that take one cannot | |
| /// drift apart. | |
| /// | |
| /// They differ in two things and this takes both: what "no such replay" means | |
| /// to the caller, which is a recording id to one route and a room to another, | |
| /// and the sentence a read error is logged under. Everything else was written | |
| /// out three times, including the two `410` bodies, and those are the retention | |
| /// promise: a copy that said something slightly different would be a third | |
| /// out twice, including the two `410` bodies, and those are the retention | |
| /// promise: a copy that said something slightly different would be a second | |
| /// answer to a question the product gives one answer to. `gone_response` below | |
| /// exists for the same reason on the route ahead of this one. | |
| /// | |
| /// A function pointer rather than a closure, because none of the three captures | |
| /// A function pointer rather than a closure, because neither route captures | |
| /// anything: what a route answers here is a constant, and a signature that | |
| /// allowed a captured one would be inviting a fourth thing to differ. | |
| /// allowed a captured one would be inviting a third thing to differ. | |
| /// One answer for every replay read, so the history events route and the | |
| /// template's replay read cannot drift apart. | |
| /// | |
| /// They differ in two things and this takes both: what "no such replay" means | |
| /// to the caller, which is a recording id to one route and a room to another, | |
| /// and the sentence a read error is logged under. Everything else was written | |
| /// out three times before the fold, including the two `410` bodies, and those | |
| /// are the retention promise: a copy that said something slightly different | |
| /// would be a second answer to a question the product gives one answer to. | |
| /// `gone_response` below exists for the same reason on the route ahead of this | |
| /// one. | |
| /// | |
| /// A function pointer rather than a closure, because no route captures | |
| /// anything: what a route answers here is a constant, and a signature that | |
| /// allowed a captured one would be inviting another thing to differ. |
| The history route and the template's replay read below are the two routes that | ||
| serve it, both answering `{"seq", "quotaExceeded", "events": [...]}`; |
There was a problem hiding this comment.
"The history route" has no single referent here: The history routes section below lists three, and only GET /api/recordings/{id}/events answers this body (GET /api/recordings/{id} answers a recording's state). Naming the route also drops the count, which goes stale the next time a reader is added or removed.
| The history route and the template's replay read below are the two routes that | |
| serve it, both answering `{"seq", "quotaExceeded", "events": [...]}`; | |
| `GET /api/recordings/{id}/events` and the template's replay read, both below, | |
| serve it, answering `{"seq", "quotaExceeded", "events": [...]}`; |
|
Remove
Then update the description: the open question is answered, and |
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:
GET /api/interviews/{id}/snapshotGET /api/recordings/{id}/eventsand the template'sGET /api/recording/replayserve the samereplay_snapshotPOST /api/interviews/{id}/endroom_finishedwebhook and theegress_endedthat carries the file, which also covers a lostroom_finished; a lostegress_endedleaves the row to the sweeperAfter 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 aninterview whose recording never started, which nothing requested.
Every other endpoint has a caller:
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.
/api/callback(GitHub OAuth redirect) and/api/recording/webhook(LiveKit)./healthzhas only test callers. It stays: only the full app answers it, thesetup server does not, and a deployment's health check would use it.
/api/peer/*: every sub-route is called fromweb/peer-*.jsexceptPOST /api/peer/sessions/{id}/terminate. It ends a running session and keepswhat 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_snapshotandfinish_recordingstay because theother routes and the webhook use them.
The removed snapshot test was the only one reaching three answers of the shared
replay_response. The expired410now has a test on the template route. Thedeleted
410is reachable only when a deletion lands between the historyroute's check and its read, so it and the
quotaExceededfield get unit testson
replay_responseintests/unit/web.rs. The contract keeps the body shapeand its Ending section names both webhooks.
Validation
./scripts/test.sh ruston this head, in a Linux arm64 container, passed:The deleted-
410andquotaExceededmutations ofreplay_responseeach failthe new unit tests, and pass every other suite.
./scripts/test.sh browseron macOS: 3555 passed, 33 skipped, 2 failed, neithertouched by this diff.
media-probefails the same way on main here(
receiver-stats-unavailable), and thestrict-selectioncached-attempt testpassed 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.Written for commit 51f0b76. Summary will update on new commits.