mirror of
https://github.com/nomadkaraoke/karaoke-gen.git
synced 2026-11-20 13:07:57 +09:00
chore: remove duplicate start-review 409 guard (v0.290.3) (#1248)
#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 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## 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. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
a10e548606
commit
5ae9d407b2
2 files changed
+2
-8
No files matched your search
@@ -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.
|
||||
|
||||
+1
-1
@@ -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 <andrew@beveridge.uk>"]
|
||||
license = "MIT"
|
||||
|
||||
Reference in new issue
Block a user