Repository navigation
Conversation
c1d3a61 to
36dad77
Compare
36dad77 to
51f0b76
Compare
|
Remove
Then update the description: the open question is answered, and |
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.
POST /api/peer/sessions/{id}/terminate has no caller either: no page
offers it. It is an action in the shared peer action table rather than
a route, so it leaves the version-check list and the cancel arm, which
now only cancels. The hard-deadline path still writes finalizing, so the
finalizing lists elsewhere stay as they are.
Delete the handlers, their route entries, their tests and the contract
text that described them. The snapshot section keeps its reasoning and
the body shape the history events route and the template's replay read
answer with, and Ending names the webhooks. replay_snapshot and
finish_recording stay, because the other routes and the webhook still
use them. The peer docs and the advice test end a session by cancel.
The removed snapshot test was the only one that reached the expired,
deleted and quota 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. The settlement test asserts
that terminate is refused like any unknown action.
Change-Id: I4edfd4efba497059ca77c4b4e342c6a4b13a883c
51f0b76 to
de0e1e2
Compare
|
Removed in de0e1e2. |
There was a problem hiding this comment.
1 issue found across 8 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/web/mod.rs">
<violation number="1" location="src/web/mod.rs:1106">
P3: This doc comment says `gone_response` is "below", but it is defined in `src/web/recordings/mod.rs`, not later in this file. Name the module so the reference resolves, e.g. "`recordings::gone_response`".</violation>
</file>
Tip: Review your code locally with the cubic CLI to iterate faster.
View guided diff | Re-trigger cubic
| /// 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 |
There was a problem hiding this comment.
P3: This doc comment says gone_response is "below", but it is defined in src/web/recordings/mod.rs, not later in this file. Name the module so the reference resolves, e.g. "recordings::gone_response".
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At src/web/mod.rs, line 1106:
<comment>This doc comment says `gone_response` is "below", but it is defined in `src/web/recordings/mod.rs`, not later in this file. Name the module so the reference resolves, e.g. "`recordings::gone_response`".</comment>
<file context>
@@ -1094,20 +1094,21 @@ fn forwarded_client(headers: &header::HeaderMap, peer: SocketAddr, hops: u32) ->
+/// 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.
///
</file context>
| /// `gone_response` below exists for the same reason on the route ahead of this | |
| /// `recordings::gone_response` exists for the same reason on the route ahead of this |
Problem and behavior
#582 asked for a review of the API endpoints and the removal of any that serve no purpose. Three 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 sweeperPOST /api/peer/sessions/{id}/terminatecancelends a session early; the hard deadline still ends one asfinalizingAfter this change the two interview paths fall through to the static fallback, as any unknown
/api/path already does, andterminateis refused asinvalid_actionlike any unknown peer action. The one read lost is the replay of an interview whose recording never started, which nothing requested.Every other endpoint has a caller:
/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 other sub-route and action is called fromweb/peer-*.js.Approach
Delete the handlers, their route entries, their tests and the contract text that described them.
replay_snapshotandfinish_recordingstay because the other routes and the webhook use them.terminatewas an action in the shared peer action table, so it leaves the version-check list and the cancel arm; thefinalizinglists stay because the hard-deadline path still writes that status.The removed snapshot test was the only one reaching the expired, deleted and quota answers of the shared
replay_response. The expired410now has a test on the template route. The deleted410is reachable only when a deletion lands between the history route's check and its read, so it and thequotaExceededfield get unit tests onreplay_responseintests/unit/web.rs. The settlement test asserts thatterminateis refused, the advice test intests/web/peer_artifacts.rsends its session bycancel, and the peer docs name cancel.Validation
./scripts/test.sh ruston this head, in a Linux arm64 container, passed. It skipped cargo-deny (not installed) and three browser tests (no Playwright browser in the container).Each new test fails against the mutation it pins and passes otherwise: the deleted
410answered as a missing replay,quotaExceededinverted or forced false,terminateadded back to the cancel arm, andcancelwritingfinalizing../scripts/test.sh browseron macOS, on the head before theterminateremoval (which touches no browser code): 3555 passed, 33 skipped, 2 failed, neither touched by this diff.media-probefails the same way on main here (receiver-stats-unavailable), and thestrict-selectioncached-attempt test passed three of three runs alone.Not run: cargo-deny.
Summary by cubic
Removes the three API endpoints 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.terminatepeer session action was never offered by any page;cancelremains and still closes the session, and the hard-deadline path still writesfinalizing.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, deleted and quota-exceeded get unit tests on
replay_response, and the settlement test now assertsterminateis refused as an invalid action. Refs #582.Written for commit de0e1e2. Summary will update on new commits.