Serve the recordings page for closed cases instead of 404 #17
Reference in New Issue
Block a user
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?
Symptom
Following the "Aufnahmen anzeigen" link on a closed case opens what looks like an empty page in the web UI.
Verified mechanism: the recordings route returns HTTP
404with the JSON body{"error":"Case not found"}rather than rendered HTML — seeserver/src/error.rs:36(NotFound→StatusCode::NOT_FOUND) andserver/src/error.rs:44(body isJson({"error": ...})). The browser shows that bare 404/JSON, which reads as a blank/empty page.Open cases are unaffected; only cases carrying the
.closedmarker hit this.Root cause
Two independent defects combine:
Handler rejects closed cases unconditionally.
handle_case_recordings(server/src/routes/user_web.rs:881) always resolves the case vialocate_case_or_404, which callslocate_case(server/src/routes/user_web.rs:940).locate_casereturnsNonewhencrate::paths::is_closedfinds the.closedmarker (server/src/paths.rs:58), producing the 404. The handler takes noQueryparameter, so it has no way to opt into closed cases — unlikehandle_case_page(server/src/routes/user_web.rs:753), which already branches onquery.include_closed()and useslocate_closed_case_or_404(server/src/routes/user_web.rs:980) whenshow_closed=1.Template drops the
show_closedflag. The "Aufnahmen anzeigen" link inserver/templates/case_page.html:747is/cases/{{ case_id }}/recordingswith no query string. The case-list template already gets this right:server/templates/my_cases.html:142appends?show_closed=1for closed cases ({% if case.is_closed %}?show_closed=1{% endif %}).Because the case page is itself only reachable for a closed case via
?show_closed=1, the recordings link must carry the same flag forward — and the handler must honour it.Acceptance
/cases/<id>/recordings?show_closed=1for a case with a.closedmarker → 200 with the recordings, not 404). Per repo policy a bug fix lands with a failing-then-green test; integration tests live in the server crate'stests/directory, not in examples.