diff --git a/package.json b/package.json index 2cc41bc..e8c3a78 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "scrum4me-mcp", - "version": "0.6.0", + "version": "0.6.1", "description": "MCP server for Scrum4Me — exposes dev-flow tools and prompts via the Model Context Protocol", "type": "module", "bin": { diff --git a/src/tools/wait-for-job.ts b/src/tools/wait-for-job.ts index d299606..389d4ef 100644 --- a/src/tools/wait-for-job.ts +++ b/src/tools/wait-for-job.ts @@ -249,12 +249,14 @@ export async function tryClaimJob( ): Promise { // Atomic claim in a single transaction — also captures plan_snapshot from task const rows = await prisma.$transaction(async (tx) => { - // SELECT FOR UPDATE OF claude_jobs SKIP LOCKED — join tasks to read implementation_plan + // SELECT FOR UPDATE OF claude_jobs SKIP LOCKED — LEFT JOIN tasks zodat + // idea-jobs (task_id IS NULL, M12) ook gevonden worden. plan_snapshot + // blijft dan NULL/'' voor idea-jobs — niet nodig (geen verify-flow). const found = productId ? await tx.$queryRaw>` SELECT cj.id, t.implementation_plan FROM claude_jobs cj - JOIN tasks t ON t.id = cj.task_id + LEFT JOIN tasks t ON t.id = cj.task_id WHERE cj.user_id = ${userId} AND cj.product_id = ${productId} AND cj.status = 'QUEUED' @@ -265,7 +267,7 @@ export async function tryClaimJob( : await tx.$queryRaw>` SELECT cj.id, t.implementation_plan FROM claude_jobs cj - JOIN tasks t ON t.id = cj.task_id + LEFT JOIN tasks t ON t.id = cj.task_id WHERE cj.user_id = ${userId} AND cj.status = 'QUEUED' ORDER BY cj.created_at ASC