fix: resolve AI CV generator internal server errors#3126
Open
YASHK-arch wants to merge 1 commit into
Open
Conversation
GSSoC Label Checklist 🏷️@Priyanshu-byte-coder — please apply the appropriate labels before merging: Difficulty (pick one):
Quality (optional):
Validation (required to score):
|
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
This PR resolves multiple 500 Internal Server Errors in the AI Resume & CV Generator flow. It fixes missing database columns in the Supabase migrations, corrects the GitHub session identifier passed to the GraphQL API, and makes Supabase caching non-fatal so that database errors don't prevent users from seeing their analysis.
Fixes #3125
Type of Change
What Changed
supabase/migrations/cv_intelligence.sql: Added the missinggenerated_atandexpires_atcolumns required by the API routes to both thecv_analysesandcv_generated_contenttables.src/app/api/cv/analyze/route.ts:session.githubIdtosession.githubLoginwhen querying the GitHub GraphQL API, as the API requires a string username, not a numeric ID.resolveGitHubLoginfallback to queryhttps://api.github.com/userfor the correct username if the JWT session holds a stale or numeric login ID.upsertso that database errors (like a missing table) log a warning rather than throwing a 500 status and breaking the request.src/app/api/cv/generate/route.ts:How to Test
cv_intelligence.sqlmigration has been run in your Supabase instance.Expected result: The application successfully fetches your GitHub data, classifies it, caches it in Supabase, and proceeds to the Resume Generation step without crashing.
Screenshots / Recordings
Before :

After:
resume.mp4
Checklist
console.log, debug code, or commented-out blocksnpm run lintpasses locallynpm run type-check)Accessibility (UI changes only)
Additional Context
Development rate limits were artificially restricting local testing, making debugging the API errors difficult. Production rate limits (
3/hrand5/hr) have been strictly preserved.