You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Show an HTML page instead of JSON for missing or invalid report IDs #111
Opening /report/doesnotexist in a browser shows raw JSON: {"detail":"Report not found"}. An invalid ID such as /report/abc-123 shows {"detail":"Invalid report ID"}. Reports expire after 30 days, so real users hit this with old links. They should see a normal page with the site header, a short explanation and a link back to the home page.
Where
app/routes/web.py, lines 234 and 238: raise HTTPException(...) in report_page().
In report_page() only (not the /api/... routes, which must keep returning JSON), render a small template such as web/templates/not_found.html instead of raising.
Return status 404 for a missing report and 400 for an invalid ID, using templates.TemplateResponse(..., status_code=...).
Copy suggestion: "This report does not exist or has expired. Reports are deleted after 30 days." plus a link to /.
Acceptance criteria
/report/abc123 returns 404 with text/html and the new page.
/report/abc-123 returns 400 with text/html.
/api/stream/abc123 still returns JSON.
A test in tests/test_api.py checks the status codes and that the body contains the message.
Welcome, Ashwinee, it's yours. The files are app/routes/web.py (report_page(), around lines 234 and 238), a new web/templates/not_found.html extending web/templates/base.html, and a test in tests/test_api.py next to the existing 404 check. Keep the /api/... routes returning JSON, and use templates.TemplateResponse(..., status_code=...) so the page returns 404 for a missing report and 400 for an invalid ID. Run pytest -q, ruff check app tests scripts and ruff format --check app tests scripts before opening the PR, and put Closes #111 in the description. Ask here if anything in report_page() is unclear. 🙂
If SlopTotal is useful to you, a ⭐ on the repository helps other people find it.
Automated reply from the SlopTotal assistant. @pablocaeg reads every thread.
Hi @8Ashwinee, checking in on this one: are you still working on it? No rush, but if you have a draft, opening a pull request (even marked as draft) shows it's in progress.
If there's no update in 7 days I'll unassign it so someone else can pick it up. You can always ask for it again.
Activity
8Ashwinee commentedon Oct 11, 2026
i would like to do this
sloptotal-bot commentedon Oct 11, 2026
Welcome, Ashwinee, it's yours. The files are
app/routes/web.py(report_page(), around lines 234 and 238), a newweb/templates/not_found.htmlextendingweb/templates/base.html, and a test intests/test_api.pynext to the existing 404 check. Keep the/api/...routes returning JSON, and usetemplates.TemplateResponse(..., status_code=...)so the page returns 404 for a missing report and 400 for an invalid ID. Runpytest -q,ruff check app tests scriptsandruff format --check app tests scriptsbefore opening the PR, and putCloses #111in the description. Ask here if anything inreport_page()is unclear. 🙂If SlopTotal is useful to you, a ⭐ on the repository helps other people find it.
Automated reply from the SlopTotal assistant. @pablocaeg reads every thread.
sloptotal-bot commentedon Nov 4, 2026
Hi @8Ashwinee, checking in on this one: are you still working on it? No rush, but if you have a draft, opening a pull request (even marked as draft) shows it's in progress.
If there's no update in 7 days I'll unassign it so someone else can pick it up. You can always ask for it again.