fix: resolve profile 500 + harden progress checks#118
Merged
Conversation
…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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
paused_at_session_idcolumn didn't exist in the DB, causing everystudentConceptStatequery to crash with P2022 — breaking profile, mastery, and diagnostic endpoints.prisma migrate deploy(already done on prod DB).courseUnlockednow checks for any progress (mastered/inProgress/needsReview > 0) instead of onlycompletionPercent > 0which only counted mastered concepts.CompletionEstimateServicenow usesactiveConceptWherefor concept counts, matching all other queries. Was including archived concepts (33 vs 10 active).countMasteredConceptswrapped withactiveConceptWherefor consistency.Test plan
🤖 Generated with Claude Code