⚡ Bolt: scope user lesson progress database queries to lesson IDs#74
⚡ Bolt: scope user lesson progress database queries to lesson IDs#74projectamazonph wants to merge 1 commit into
Conversation
Scope lessonProgress database queries in key dashboard, course index, and pending lessons certificate pages to relevant course or published-course lesson IDs using `{ lessonId: { in: allLessonIds } }`. This avoids fetching the student's entire history, minimizing database payload size and memory consumption as progress records accumulate over time.
Co-authored-by: projectamazonph <286085559+projectamazonph@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughDashboard, course index, and certificate pages now scope ChangesLesson progress query scoping
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration. Comment |
💡 What
Scoped the user's
lessonProgressqueries on the dashboard (src/app/(dashboard)/dashboard/page.tsx), courses index (src/app/(dashboard)/courses/page.tsx), and pending certificate lessons (src/app/(dashboard)/courses/[courseSlug]/certificate/page.tsx) to only query matching relevant lesson IDs using{ lessonId: { in: allLessonIds } }.🎯 Why
Previously, these pages retrieved the student's entire unconstrained lesson progress history from the database. As students complete more lessons across multiple courses, fetching unconstrained history results in unnecessary database payload, memory bloating, and progressive query degradation.
📊 Impact
lessonProgressrows specifically to the context being viewed.🔬 Measurement
All Vitest unit/integration tests and typecheck checks pass successfully.
PR created automatically by Jules for task 15107616431700706947 started by @projectamazonph
Summary by CodeRabbit
Performance
Bug Fixes