Skip to content

fix: resolve profile 500 + harden progress checks#118

Merged
willwearing merged 1 commit into
mainfrom
fix/profile-500-and-progress-logic
Apr 12, 2026
Merged

fix: resolve profile 500 + harden progress checks#118
willwearing merged 1 commit into
mainfrom
fix/profile-500-and-progress-logic

Conversation

@willwearing
Copy link
Copy Markdown
Owner

Summary

  • Root cause: 3 pending Prisma migrations never applied to production. The paused_at_session_id column didn't exist in the DB, causing every studentConceptState query to crash with P2022 — breaking profile, mastery, and diagnostic endpoints.
  • Migrations applied via prisma migrate deploy (already done on prod DB).
  • courseUnlocked now checks for any progress (mastered/inProgress/needsReview > 0) instead of only completionPercent > 0 which only counted mastered concepts.
  • CompletionEstimateService now uses activeConceptWhere for concept counts, matching all other queries. Was including archived concepts (33 vs 10 active).
  • countMasteredConcepts wrapped with activeConceptWhere for consistency.

Test plan

  • Verified profile endpoint returns 200 with correct data after migration
  • Verified diagnostic assessment loads and shows questions
  • Verified dashboard shows correct concept counts (10, not 33)
  • Backend type-checks clean

🤖 Generated with Claude Code

…ecks

Root cause: 3 pending migrations (paused_at_session_id, key_prerequisite,
kp_failed_session_tracking) were never applied to production. Every query
selecting from studentConceptState crashed with P2022 (column not found),
breaking profile, mastery, and diagnostic endpoints.

Applied migrations via `prisma migrate deploy`.

Also fixes:
- courseUnlocked now checks mastered/inProgress/needsReview > 0 instead
  of only completionPercent > 0 (which only counted mastered concepts)
- CompletionEstimateService uses activeConceptWhere for totalConcepts
  count, matching ensureConceptStatesForAcademy (was including archived)
- countMasteredConcepts wraps filter with activeConceptWhere for
  consistency with all other student state queries
- Dashboard "Continue Studying" uses same broadened progress check

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 12, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
graspful Building Building Preview, Comment Apr 12, 2026 2:47pm

@willwearing willwearing merged commit 9f1863f into main Apr 12, 2026
2 of 3 checks passed
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.

1 participant