Nobody has started this yet — be first.
Business impact
GET /v1/dlq is the list an on-call engineer works through during an incident, and the documented (and generally correct) triage order is oldest-first -- the job that's been failing the longest is usually the most SLA-critical, and working newest-first means it gets addressed last, if at all, once the queue empties enough that someone stops looking. This bug only affects the Redis backend, which is specifically the one this project recommends for production (STORE_BACKEND=memory is the zero-setup dev default) -- so it's the textbook "worked fine in every local/dev test, broke specifically in the production configuration" pattern.
Problem
dlq.Store.List is documented (and MemoryStore's implementation still does this correctly) to return jobs oldest-first. RedisStore.List's sort comparator is inverted.
Current behavior
RedisStore.List(ctx) returns dead-lettered jobs newest-first. MemoryStore.List(ctx) is unaffected and still returns oldest-first.
Expected behavior
Both backends return jobs in the same order: oldest CreatedAt first.
Steps to reproduce
store := dlq.NewRedisStore(client) store.Push(ctx, dlq.Job{ID: "a", CreatedAt: t0}) store.Push(ctx, dlq.Job{ID: "b", CreatedAt: t0.Add(time.Second)}) list, _ := store.List(ctx) fmt.Println(list[0].ID) // got: "b" (newest), want: "a" (oldest)
Why this matters
Both backends are supposed to be interchangeable behind the same Store interface -- a caller (or test) that only exercises the memory backend in CI and only discovers the Redis backend's behavior in staging/production learns about this divergence at exactly the wrong time.
Suggested approach
Compare RedisStore.List's sort.Slice comparator in pkg/dlq/redis.go against MemoryStore.List's in pkg/dlq/memory.go -- they should be doing the identical comparison; only one of the two currently is.
Acceptance criteria
Verification
go test ./test/ -run TestTask09 -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/dlq-redis-sort-directionFix it and commit
Meet every acceptance criterion, and add a test that would have caught this.
Push the branch
$git push -u origin fix/dlq-redis-sort-directionSubmit 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 inhttp://localhost:8080POST /v1/chargesTo run against Redis (the multi-replica-safe backend) with zero local setup:
docker compose up --build # app + redis, hot-reloading on save
Work the tickets in tasks/ (ordered easy → hard); each names one Go test in test/:
make test-race # go test -race -count=1 ./...
go test ./test/ -run TestTask01 -v # a single ticket
Level 1
Fix a bug
Read existing behaviour, correct it.