Nobody has started this yet — be first.
Business impact
Every bookmark a user saves loses its tags on the way in -- tags are the entire organizing mechanism of this product, so this bug makes tag-based filtering and search-by-tag completely non-functional for every user, silently. Nobody gets an error; their bookmarks just save with no tags, and they won't notice until they go looking for something and it isn't where they expected.
Problem
normalizeTags is supposed to trim whitespace from each tag and drop empty ones. Right now it keeps only the tags that trim down to an empty string, and discards every real tag.
Current behavior
Creating a bookmark with tags ["reading","tech"] returns and stores tags: [] -- every real tag is gone, with no error anywhere.
Expected behavior
Real (non-empty, after trimming) tags are kept, exactly as supplied (order-preserving); only genuinely empty/whitespace-only tag entries are dropped.
Steps to reproduce
curl -s -X POST http://localhost:8081/bookmarks -H 'Content-Type: application/json'
-d '{"url":"https://example.com/article","title":"An Article","tags":["reading","tech"]}'
Why this matters
A boolean condition (t != "" vs. t == "") got inverted -- the function still compiles, still runs, still returns a []string, and nothing about its shape changes, so nothing type-level catches it. This is exactly why the project's own test suite asserts on the contents of tags, not just that the field exists.
Suggested approach
Look at the if condition inside normalizeTags's loop and think about which tags it's supposed to keep versus which it's currently keeping.
Acceptance criteria
Verification
go test ./practicetickets/... -run TestTicket01 -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 fix/tags-stripped-on-saveFix it and commit
Meet every acceptance criterion, and add a test that would have caught this.
Push the branch
$git push -u origin fix/tags-stripped-on-saveSubmit 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 inmigrations/0001_init.sqlcurl http://localhost:8081/healthz
# {"status":"ok"}
To run without Docker, point the DB_* env vars from .env.example at a reachable Postgres and run go run ./cmd/server -- it applies the same migrations on startup.
The project's own test suite (go test ./...) is an integration suite against a real Postgres; it looks for one via BM_TEST_DB_HOST/BM_TEST_DB_PORT/BM_TEST_DB_USER/BM_TEST_DB_PASSWORD/BM_TEST_DB_NAME (defaults point at localhost:15433, database bookmarks_test) and skips cleanly rather than failing if that database is unreachable:
docker run -d --name bm_test_pg -e POSTGRES_PASSWORD=postgres \
-e POSTGRES_DB=bookmarks_test -p 15433:5432 postgres:16-alpine
Work the tickets in PRACTICE_TICKETS.md (TICKET-01 through TICKET-10, all in one file, ordered easy -> hard); each names one Go test under practicetickets/:
go test ./practicetickets/... -run TestTicket01 -v # a single ticket
./practice_tickets_run.sh # all 10, clean pass/fail summary table
Level 1
Fix a bug
Read existing behaviour, correct it.