Skip to content

fix: resolve AI CV generator internal server errors#3126

Open
YASHK-arch wants to merge 1 commit into
Priyanshu-byte-coder:mainfrom
YASHK-arch:fix/cv-generator-500-errors
Open

fix: resolve AI CV generator internal server errors#3126
YASHK-arch wants to merge 1 commit into
Priyanshu-byte-coder:mainfrom
YASHK-arch:fix/cv-generator-500-errors

Conversation

@YASHK-arch

Copy link
Copy Markdown
Contributor

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

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 💥 Breaking change (fix or feature that changes existing behavior)
  • 📝 Documentation update
  • ♻️ Refactor / code cleanup (no functional change)
  • ⚡ Performance improvement
  • 🔒 Security fix
  • 🧪 Tests only

What Changed

  • supabase/migrations/cv_intelligence.sql: Added the missing generated_at and expires_at columns required by the API routes to both the cv_analyses and cv_generated_content tables.
  • src/app/api/cv/analyze/route.ts:
    • Changed session.githubId to session.githubLogin when querying the GitHub GraphQL API, as the API requires a string username, not a numeric ID.
    • Added a resolveGitHubLogin fallback to query https://api.github.com/user for the correct username if the JWT session holds a stale or numeric login ID.
    • Wrapped the Supabase cache upsert so that database errors (like a missing table) log a warning rather than throwing a 500 status and breaking the request.
    • Relaxed development rate limits from 3 requests/hour to 100 requests/hour for easier local testing.
  • src/app/api/cv/generate/route.ts:
    • Relaxed development rate limits from 5 requests/hour to 100 requests/hour.

How to Test

  1. Ensure the cv_intelligence.sql migration has been run in your Supabase instance.
  2. Sign into DevTrack locally or on staging.
  3. Navigate to the AI Resume Generator page and click "Analyze My GitHub Footprint".
  4. Verify that the analysis completes 100% without throwing a 500 error.

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 :
image

After:

resume.mp4

Checklist

  • Linked the related issue above
  • Self-reviewed my own diff
  • No unnecessary console.log, debug code, or commented-out blocks
  • npm run lint passes locally
  • No TypeScript errors (npm run type-check)
  • Added or updated tests where applicable
  • Updated documentation / comments if behavior changed

Accessibility (UI changes only)

  • Keyboard navigation works correctly
  • Color contrast meets WCAG AA standard
  • ARIA labels / roles added where needed
  • Tested on mobile / responsive layout

Additional Context

Development rate limits were artificially restricting local testing, making debugging the API errors difficult. Production rate limits (3/hr and 5/hr) have been strictly preserved.

@github-actions github-actions Bot added gssoc26 GSSoC 2026 contribution type:bug GSSoC type bonus: bug fix type:feature GSSoC type bonus: new feature type:performance GSSoC type bonus: performance (+15 pts) labels Jul 3, 2026
@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown

GSSoC Label Checklist 🏷️

@Priyanshu-byte-coder — please apply the appropriate labels before merging:

Difficulty (pick one):

  • level:beginner — 20 pts
  • level:intermediate — 35 pts
  • level:advanced — 55 pts
  • level:critical — 80 pts

Quality (optional):

  • quality:clean — ×1.2 multiplier
  • quality:exceptional — ×1.5 multiplier

Validation (required to score):

  • gssoc:approved — counts for points
  • gssoc:invalid / gssoc:spam / gssoc:ai-slop — does not score

Type labels (type:*) are auto-detected from files and title. Review and adjust if needed.
Points formula: (difficulty × quality_multiplier) + type_bonus

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc26 GSSoC 2026 contribution type:bug GSSoC type bonus: bug fix type:feature GSSoC type bonus: new feature type:performance GSSoC type bonus: performance (+15 pts)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] AI Resume & CV Generator fails with 500 Internal Server Error due to missing database columns and incorrect GitHub session ID

1 participant