mirror of
https://github.com/nomadkaraoke/karaoke-gen.git
synced 2026-11-20 13:07:57 +09:00
## Why Investigating two bad community picks for one user (jobs 8695c32e, 94c83a7e) found: - a YouTube-bot request was "claimed" by a vote that was later moved, leaving a 0-vote request with a stale owner that was still pickable (`vote_count >= 0`); - the daily pick's `select_best` raised on remote (dict) results and silently fell back to result #0 (logged as a WARNING on 7 days since 10 Oct). ## What - **Real users only:** every request must belong to a real user email (`require_real_email`, enforced in the service); the YouTube comment bot no longer creates requests, it replies with how to request on the board. Legacy placeholder rows are never listed/picked/credited. - **Limits:** 1 request + 1 vote per day (submitting spends the vote → `409 vote_already_used`; `429 submission_limit`). The cap uses a create-only per-day marker, so deleting a request doesn't give the submission back (purged on account deletion). - **Last up-vote deletes the request** after confirmation (`409 would_delete_request` + `request_id` until `confirm_delete=true`), freeing remaining voters' votes. Replaces the claim logic. - **Picker:** needs `vote_count >= 1` and an owner who still up-votes it and hasn't owned it already; deleting a community job reopens its request (or deletes it if nobody backs it). - **Audio:** unattended pick only on an exact artist+title match (torrent ≥3 seeders, else Spotify; ambiguity → none). Otherwise the job parks in `AWAITING_AUDIO_SELECTION` and the owner is emailed. - **Email:** community-pick review email says the song came from the requests board. - **UI:** confirm before spending the daily vote / submitting, thank-you panel with credit-pack CTA (`/app?buy=1`), form disabled once the vote is spent, delete-request warning. Strings in all 33 frontend locales + en/es/de backend. ## Testing - Emulator tests for all service rules (real Firestore transactions), unit tests for routes, audio pick, daily pick parking, notifications; Jest tests for the board client. - Local CodeRabbit review run; all 7 findings fixed. - Note: a handful of existing job-creation emulator tests and `test_internal_api` auth tests fail identically on clean `origin/main` in my local env; CI is the judge. Plan: docs/archive/2026-10-26-requests-board-overhaul-plan.md. Docs: REQUESTS-BOARD.md, API.md, LESSONS-LEARNED.md. @coderabbitai ignore 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>