Nobody has started this yet — be first.
Business impact
A user deciding whether to save a new city (e.g. searching "should I add Berlin to my dashboard?") has to actually save it first just to see its current weather -- there's no "preview before you commit" flow. This is friction on exactly the action (adding a city) the product most wants to be frictionless.
Problem
GET /dashboard always resolves weather for the caller's saved city list only. The diagnostic benchmark endpoint (GET /diagnostics/benchmark) already supports an ad-hoc ?cities=a,b,c override that bypasses the saved list entirely -- but the main dashboard endpoint has no equivalent.
Current behavior
GET /dashboard?cities=Berlin,Madrid ignores the query parameter entirely and returns weather for the caller's saved cities only, with no way to preview an unsaved city.
Expected behavior
GET /dashboard?cities=Berlin,Madrid fetches weather for exactly the given (comma-separated) cities instead of the caller's saved list -- using the same cache/fetch/parallel machinery as today, just with a different city-name source. Omitting ?cities= keeps today's "use my saved list" behavior exactly as-is.
Steps to reproduce
curl -X POST http://localhost:8083/cities -H 'X-User-ID: alice' -d '{"name": "Osaka"}' curl "http://localhost:8083/dashboard?cities=Berlin,Madrid" -H 'X-User-ID: alice'
Why this matters
The parsing/splitting logic for this exact query-param shape already exists, working correctly, in handleBenchmark a few lines below in the same file -- this ticket is about reusing that pattern for the main dashboard path rather than inventing a new one, and resisting the temptation to just copy-paste it awkwardly instead of factoring out the shared bit.
Suggested approach
Look at how handleBenchmark parses ?cities= into a []string of city names, and apply the same approach in handleDashboard, falling back to s.cities.List(...) (today's only behavior) when ?cities= is absent.
Acceptance criteria
Verification
WD_TEST_DATABASE_URL=postgresql://... go test ./practicetickets/... -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
$git checkout -b feat/dashboard-ad-hoc-citiesFix it and commit
Meet every acceptance criterion, and add a test that would have caught this.
Push the branch
$git push -u origin feat/dashboard-ad-hoc-citiesSubmit 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 inweather_dashboarddbappmockweatherWEATHER_API_BASE_URL=https://api.openweathermap.orgWEATHER_API_KEYdocker-compose.prod.ymlRun the project's own test suite:
make test # go test ./...
make test-race # go test -race ./... (includes the concurrency/partial-failure test)
Work the tickets in PRACTICE_TICKETS.md (TICKET-01 through TICKET-10); each names one Go test in practicetickets/:
./practice_tickets_run.sh # all 10, pass/fail summary
go test ./practicetickets/... -run TestTicket01 -v # a single ticket
go test -race ./practicetickets/... -run TestTicket10 -v # ticket 10 needs -race to observe its bug
Tickets 03, 04, 05, and 06 touch the saved-cities Postgres store and need a reachable test database, set via WD_TEST_DATABASE_URL (defaults to postgres://postgres:postgres@localhost:5436/weather_dashboard_test if unset). Tickets 01, 02, 07, 08, 09, and 10 need no database at all.
Level 2
Implement a feature
Extend the system within its own patterns.