fix: projects page HTTP 500 — remove invalid labels include#102
Conversation
labels is a scalar String[] field, not a relation, so it cannot be used in Prisma include. It's automatically included in queries. This fixes the HTTP 500 on the Projects page.
|
✅ Automated recommendation: APPROVE Analysis engine: anthropic/MiniMax-M2.7@https://litellm.jory.dev/v1 (anthropic) PR Review: fix: projects page HTTP 500 — remove invalid labels includeRecommendation: ApproveThis PR correctly fixes the root cause of the Projects page HTTP 500 error by removing Change-by-Change Findings
|
| Before | After |
|---|---|
include: { repository: true, labels: true } |
include: { repository: true } |
Finding: The change is minimal, targeted, and correct. Prisma's include option only accepts relation fields. labels on the Issue model is a scalar String[] field (confirmed by repository schema references showing labels as a direct field, not a relation). The fix follows Option A from the issue's recommended solutions.
Evidence: Repository Impact Scan shows consistent usage of labels as a scalar field in audit logging patterns (beforeLabels, afterLabels as String[]), confirming labels is not a relation.
Sources
- PR body: Describes the bug and fix rationale
- Linked Issue Projects page does not load in web UI #101: Full root cause analysis with Prisma error message and two fix options
- GitHub log history: HEAD commit confirms branch and fix description
Standards Compliance
✅ Prisma schema conventions (AGENTS.md): Repository follows Prisma best practices. The include option should only reference relations (repository is a @relation field on Issue). Removing the invalid labels: true scalar reference aligns with "Keep relations strict; do not make foreign keys nullable to hide bugs."
✅ Code Standards: The fix validates correctly against the repository's patterns. The Board page (src/app/board/page.tsx) already uses include: { repository: true } without labels, confirming this is the established convention for the codebase.
✅ No agent-specific names: N/A — pure data fix.
✅ Error handling: Fixes a PrismaClientValidationError that was causing HTTP 500 responses, replacing it with valid Prisma queries.
Linked Issue Fit
Issue #101 — Projects page does not load in web UI
| Acceptance Criteria | Status |
|---|---|
Fix include: { labels: true } (scalar in include) |
✅ Fixed — removed labels: true |
| Affected file matches issue location | ✅ src/app/projects/page.tsx — confirmed |
| Fix approach matches issue recommendation | ✅ Option A (remove from include) — followed |
| References issue in PR body | ✅ "Fixes #101" in PR body |
The PR fully satisfies the issue requirements: it identifies the correct root cause, applies the recommended fix, and targets the exact file and line described in issue #101.
Evidence Provider Findings
No evidence providers configured for this repository. No findings to report.
Tool Harness Findings
- Mode:
plan_execute_once— no tool requests executed - Status: No verification performed — tool harness did not run queries against the repository
- Note: The single-line diff is self-verifying against Prisma semantics. The fix is straightforward and does not require runtime verification to confirm correctness.
Unknowns / Needs Verification
- No test coverage verified: Tool harness did not execute test suite. The repository appears to have test files (e.g.,
route.test.tspatterns visible in the repository scan), but whethersrc/app/projects/page.tsxhas associated unit tests is not confirmed. - Schema not directly examined: The
prisma/schema.prismafile was not fetched, so the exact field type declaration forIssue.labelsis not confirmed. However, the issue description, PR body, and repository patterns all consistently indicatelabelsis a scalarString[], not a relation.
These unknowns are low-risk given the simplicity and correctness of the fix.
Summary
This is a well-scoped bug fix that:
- Addresses the exact error described in issue Projects page does not load in web UI #101
- Uses the recommended fix approach (remove invalid include)
- Matches established codebase patterns (Board page)
- Is minimal (1 file, 1 line changed)
- Fixes a real user-impacting issue (HTTP 500 on Projects page)
No blockers identified. Approve.
Problem
The Projects page returns HTTP 500 because
getProjects()usesinclude: { labels: true }on the PrismaIssuemodel, butlabelsis a scalarString[]field, not a relation. Prisma throws aValidationErrorfor non-relation fields ininclude.Fix
Remove
labels: truefrom theincludestatement. Scalar fields are automatically included in queries — no explicit include needed.Before:
After:
References