Duplicated validation logic + unguarded JSON parse #5
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Type
Bug
Lineage
plan-wkq→ Phase 14 → QA nits from PR #2Repo
forgejo_admin/westside-contractsWhat Broke
Three issues found in QA review of PR #2:
validation.tshas tested validation functions but+server.tsduplicates the logic inline — they will divergerequest.json()in the sign endpoint is unguarded — malformed JSON body returns 500 instead of 400Repro Steps
POST /contract/{token}/sign→ returns 500validation.tslogic →+server.tsinline checks don't update → divergenceExpected Behavior
Environment
src/routes/contract/[token]/sign/+server.ts,src/lib/validation.ts,.woodpecker.yamlAcceptance Criteria
validateSignRequestfrom validation.tsRelated
project-westside-basketballScope Review: NEEDS_REFINEMENT
Review note:
review-313-2026-03-27Three issues found during scope review:
arch:westside-appbut all work is inwestside-contracts. Should bearch:contract-flow(consistent with other contract items on the board)..woodpecker.yaml(note: issue says.yml, actual extension is.yaml) already containsnpm testat line 23. Acceptance criterion #4 is pre-satisfied. Remove from scope and update title to reflect two remaining bugs (validation duplication + JSON parse).File targets verified:
+server.tsline 30 has unguardedrequest.json(), lines 32-46 duplicatevalidation.tslogic, andvalidateSignRequestis never imported. 12 existing tests pass. No blast radius to sibling services.Scope Review Corrections Needed
From
review-313-2026-03-27:Fix 1: Board label corrected:
arch:westside-app→arch:contract-flow(done).Fix 2: Remove CI sub-issue from title and body.
.woodpecker.yamlalready hasnpm testat line 23 — this was fixed since the ticket was filed. Also fix file extension:.yml→.yaml.Fix 3: Add acceptance criterion: "New test added for malformed JSON body returning 400."
Once fixed → READY for next_up.
Duplicated validation logic + missing test step in CI + unguarded JSON parseto Duplicated validation logic + unguarded JSON parseIssue body updated per scope review corrections.