Skip to content

fix: projects page HTTP 500 — remove invalid labels include#102

Merged
joryirving merged 1 commit into
mainfrom
fix/projects-page-500
May 18, 2026
Merged

fix: projects page HTTP 500 — remove invalid labels include#102
joryirving merged 1 commit into
mainfrom
fix/projects-page-500

Conversation

@itsmiso-ai

Copy link
Copy Markdown
Contributor

Problem

The Projects page returns HTTP 500 because getProjects() uses include: { labels: true } on the Prisma Issue model, but labels is a scalar String[] field, not a relation. Prisma throws a ValidationError for non-relation fields in include.

Fix

Remove labels: true from the include statement. Scalar fields are automatically included in queries — no explicit include needed.

Before:

include: { repository: true, labels: true }

After:

include: { repository: true }

References

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.
@its-miso

its-miso Bot commented May 18, 2026

Copy link
Copy Markdown
Contributor

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 include

Recommendation: Approve

This PR correctly fixes the root cause of the Projects page HTTP 500 error by removing labels: true from the Prisma include statement, where labels is a scalar String[] field that cannot be used with include.


Change-by-Change Findings

src/app/projects/page.tsx (line ~12)

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

  1. No test coverage verified: Tool harness did not execute test suite. The repository appears to have test files (e.g., route.test.ts patterns visible in the repository scan), but whether src/app/projects/page.tsx has associated unit tests is not confirmed.
  2. Schema not directly examined: The prisma/schema.prisma file was not fetched, so the exact field type declaration for Issue.labels is not confirmed. However, the issue description, PR body, and repository patterns all consistently indicate labels is a scalar String[], 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.

@joryirving joryirving merged commit f919fc1 into main May 18, 2026
3 checks passed
@joryirving joryirving deleted the fix/projects-page-500 branch May 18, 2026 02:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Projects page does not load in web UI

2 participants