⚡ Bolt: Optimize articles API payload - #7
Conversation
- Replaces `include` with explicit `select` in `GET /api/articles` - Excludes large `content` and `contentHash` fields from `SecurityArticle` - Excludes unused `description` field from `Cve` - Reduces payload size and database I/O for the articles list view This change improves performance by avoiding over-fetching of large text fields that are not displayed in the frontend list. Co-authored-by: mkk2026 <175357468+mkk2026@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. |
📝 WalkthroughWalkthroughThis PR adds documentation on Prisma query optimization for over-fetching and implements explicit field-level selection in the articles API endpoint. The articles endpoint now uses defined select projections instead of relation-based inclusion to return only necessary fields, reducing payload size. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
⚡ Bolt Optimization
What:
Modified the
GET /api/articlesendpoint to use Prisma'sselectinstead ofinclude.Why:
The previous implementation fetched all fields of
SecurityArticle(including the potentially largecontentfield) and all fields ofCve. The frontend list view does not display the article content or the CVE description, making this data transfer wasteful.Impact:
Verification:
id,url,title,summary, etc.) are still returned.contentandcontentHashare no longer returned.PR created automatically by Jules for task 13850386038228845065 started by @corebrimtech
Summary by CodeRabbit
Performance
Documentation