From 5ae9d407b2f470c2d5364e267719729f86de13fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrew=20Beveridge=20=E2=98=84=EF=B8=8F?= Date: Tue, 3 Nov 2026 18:30:59 -0500 Subject: [PATCH] chore: remove duplicate start-review 409 guard (v0.290.3) (#1248) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #1243 and #1246 merged within minutes of each other and both added a 409 to `start-review`. This removes the one from #1246. The guard from #1243 stays, since it also handles losing the race to auto-approval. No behaviour change for a finished job, and the #1246 test for it stays. The two guards differ for statuses like `lyrics_complete`, which could technically move to `in_review`: under the #1243 guard those already get a 409. Docs-free, small diff; no local CodeRabbit run, so the bot can review it. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_012RYLVTajJiZnzPUt9qsVEJ ## Summary by CodeRabbit * **Bug Fixes** * Starting a review is now limited to jobs awaiting review or already in review; other job statuses receive a conflict response. * Repeated requests to open an eligible review remain safe, and concurrent state changes are handled using the job’s current status. Co-authored-by: Claude Opus 5.5 --- backend/api/routes/jobs.py | 8 +------- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/backend/api/routes/jobs.py b/backend/api/routes/jobs.py index 193c559d..02d091c2 100644 --- a/backend/api/routes/jobs.py +++ b/backend/api/routes/jobs.py @@ -22,7 +22,7 @@ from google.cloud.exceptions import NotFound from backend.utils.loop_bridge import run_in_body_thread, run_on_loop from backend.utils.request_helpers import get_client_ip from backend.services.review_state import ensure_in_review -from backend.models.job import Job, JobCreate, JobResponse, JobStatus, STATE_TRANSITIONS +from backend.models.job import Job, JobCreate, JobResponse, JobStatus from backend.models.requests import ( URLSubmissionRequest, CorrectionsSubmission, @@ -1114,12 +1114,6 @@ def start_review( if not _check_job_ownership(job, auth_result): raise HTTPException(status_code=403, detail=t(locale, "jobs.noPermissionAccess")) - # The review is over (auto-approved, submitted, finished): an expected answer - # for a stale link or notification, not a server error. Clients go to the job. - if job.status != JobStatus.IN_REVIEW and JobStatus.IN_REVIEW not in STATE_TRANSITIONS.get(job.status, []): - logger.info(f"Job {job_id}: start-review refused, status is {job.status}") - raise HTTPException(status_code=409, detail=t(locale, "jobs.reviewCannotStart")) - # Idempotent: concurrent/duplicate opens (React double-mount, double-tap, two # tabs) must not fail with "in_review -> in_review". Already in review == success, # and the one-time side effects (record_review_started) are not repeated. diff --git a/pyproject.toml b/pyproject.toml index 73c4dc76..7c01cf88 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "karaoke-gen" -version = "0.290.2" +version = "0.290.3" description = "Generate karaoke videos with synchronized lyrics. Handles the entire process from downloading audio and lyrics to creating the final video with title screens." authors = ["Andrew Beveridge "] license = "MIT"