Nobody has started this yet — be first.
Business impact
The payment_timeouts.status column is the audit trail an on-call engineer or a support ticket investigation reaches for to answer "did this payment's timeout actually go off, or did it correctly get skipped because the payment had already moved on?" If that column is backwards, every such investigation gets the exact opposite answer -- "invalidated" when it really fired, "fired" when it was really a stale no-op. It won't break anything functionally, but it will actively mislead anyone who trusts this table, which is worse than having no record at all.
Problem
A timeout that genuinely fires (the payment really did transition) gets its payment_timeouts row marked status = 'invalidated'. A stale timeout that's correctly skipped gets marked status = 'fired'.
Current behavior
payment_timeouts.status reads "invalidated" for a timeout that actually fired, and "fired" for one that was correctly skipped as stale.
Expected behavior
Fired timeouts should be marked 'fired'; correctly-skipped stale ones should be marked 'invalidated' -- matching what the column name and every comment around it already say.
Steps to reproduce
TEST_DATABASE_URL=postgresql://... go test ./tickets/tests/... -run TestTicket11 -v
Why this matters
fireOne calls service.ApplyTimeoutEvent, gets back a fired bool, and then picks a finalStatus string based on it before writing it to payment_timeouts.status. The if/else branches choosing that string are swapped relative to the fired value.
Suggested approach
Look at the if fired { ... } else { ... } block in fireOne right after the call to service.ApplyTimeoutEvent, and check which string literal ("fired" vs "invalidated") each branch assigns against what fired actually means in each branch.
Acceptance criteria
Verification
TEST_DATABASE_URL=postgresql://... go test ./tickets/tests/... -run TestTicket11 -v && TEST_DATABASE_URL=postgresql://... go test ./internal/timeout/... -race -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/sweeper-status-invertedFix it and commit
Meet every acceptance criterion, and add a test that would have caught this.
Push the branch
$git push -u origin fix/sweeper-status-invertedSubmit 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 indocker composepaystate/paystate/go.modreplace reliable => ../reliabledocker compose up --buildpaystate/context: ..docker-compose.ymlCREATED_TIMEOUTAUTHORIZED_TIMEOUTWork the tickets in tickets/docs/ (ticket-01 through ticket-25); each names one Go test in tickets/tests/:
TEST_DATABASE_URL=postgresql://... go test ./tickets/tests/... -run TestTicket01 -v # a single ticket
TEST_DATABASE_URL=postgresql://... ./tickets/run_tickets.sh # all 25, clean pass/fail summary
Tickets that don't touch Postgres (02, 03, 04, 05, 06, 14, 15, 24) run fine without TEST_DATABASE_URL set; the rest report FAIL with a "TEST_DATABASE_URL not set" message if it's missing. make test-race runs the full go test -race -p 1 ./... suite the same way.
Level 1
Fix a bug
Read existing behaviour, correct it.