Nobody has started this yet — be first.
Business impact
Log-based monitoring and alerting (e.g. "page if the 5xx rate exceeds X%") is completely blind: every request, whether it succeeded, was rejected, or crashed, is logged with the same meaningless status. A real outage -- every request suddenly 500ing -- would produce logs that look identical to a healthy service. On-call has no way to tell from the logs alone that anything is wrong.
Problem
Every access log line's status field is 0, regardless of what status code was actually sent to the client.
Current behavior
AccessLog wraps the response writer in a chi WrapResponseWriter to read back .Status() after the handler runs, but calls next.ServeHTTP with the original, unwrapped writer, so the wrapper never observes the response and .Status() stays at its zero value.
Expected behavior
The access log should record the real HTTP status code the client received.
Steps to reproduce
go test ./tickets/tests/... -run TestTicket06 -vWhy this matters
AccessLog wraps the http.ResponseWriter in a chi WrapResponseWriter specifically so it can read back .Status() after the handler runs -- but it then calls next.ServeHTTP with the original, unwrapped writer, not the wrapper. The real handler writes its response straight to the original writer; the wrapper never observes any of it, so stays at its unset zero value forever.
Suggested approach
Look at the two variables AccessLog creates (w, the parameter, and ww, the wrapper) and check which one gets passed to next.ServeHTTP.
Acceptance criteria
Verification
TEST_DATABASE_URL=postgresql://... go test ./tickets/tests/... -run TestTicket06 -v
Hints (0/2)
Try it without hints first — the reading is the exercise.
Working on this ticket
Work on a branch named for the ticket — that's what you'll submit.
Branch off your fork
Sign in to create it automatically, or do it yourself:
$git checkout -b fix/access-log-wrong-statusFix it and commit
Meet every acceptance criterion, and add a test that would have caught this.
Push the branch
$git push -u origin fix/access-log-wrong-statusSubmit it below
Paste your fork URL and the branch name, with a short write-up of the root cause.
Questions
Ask about anything unclear in the ticket — the maintainer and anyone who has solved it can answer. Please don't post full solutions.
Sign in to ask a question or reply.
Sign in.Status()SKIP LOCKEDhttp://localhost:8081localhost:5434flash-saleeveryday-widgetcurl localhost:8081/healthzgo run ./cmd/loadtest -url http://localhost:8081 -sku flash-sale -concurrency 10000Work the tickets in tickets/docs/ (ordered easy → hard); each names one dedicated Go test in tickets/tests/:
export TEST_DATABASE_URL=postgresql://inventory:inventory@localhost:5432/inventory_test?sslmode=disable
go test ./tickets/tests/... -run TestTicket24 -v # a single ticket
./tickets/run_tickets.sh # all 25, clean pass/fail summary
Tickets that don't touch Postgres (02, 07, 17, 19) run fine without TEST_DATABASE_URL; the rest t.Skip cleanly, not fail, if it's unset.
Level 1
Fix a bug
Read existing behaviour, correct it.