fix(modules): stop health fetch spam on /modules#2347
Conversation
…te date handling; refactor module loading logic in index page
|
@DarlanPrado is attempting to deploy a commit to the Nuxt Team on Vercel. A member of the Team first needs to authorize it. |
|
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 (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe module list now retrieves health data with deferred deduplication and Nuxt payload/static cache fallback. Health values are merged in the modules page rather than the shared modules composable. Pagination uses a visible-count slice and resets when search, category, sort, or order changes. Estimated code review effort: 3 (Moderate) | ~20 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@app/pages/modules/index.vue`:
- Around line 87-90: Update the pagination timer in the filter/sort watcher to
store its setTimeout handle and clear any pending timer before resetting filters
or scheduling a new load. Ensure the callback still increments visibleCount and
resets isLoading only when the timer has not been cancelled.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 0796c8d4-072e-4672-9022-78e692a76264
📒 Files selected for processing (4)
app/components/module/ModuleItem.vueapp/composables/useModuleHealth.tsapp/composables/useModules.tsapp/pages/modules/index.vue
… ensuring proper cleanup
|
@danielroe @Flo0806 this PR resolves #2346 ? |
|
Thx and sorry for the mistake ❤️ |
🔗 Linked issue
resolves #2346
📚 Description
After #2189,
/modulesstarted spamming/api/v1/modules/health(Firefox showsNS_BINDING_ABORTED).useModuleHealth()lived insideuseModules(), and eachModuleItemcalleduseModules()only forselectedSort. Infinite scroll mounted more cards → moreuseFetchcalls with the same key → defaultdedupe: 'cancel'aborted the previous request.This PR fixes that by:
ModuleItemfrom callinguseModules(passsortKeyas a prop instead)useModuleHealthwithdedupe: 'defer'+getCachedDatavisibleCount+ computed so health updates don’t remount the whole gridFollow-up refactor (not required for the fix):
A second commit moves the health merge out of
useModulesand into/modules(same pattern as the homepage). That keeps health opt-in for pages that show the badge (useNavigation/ changelog no longer trigger the fetch). The spam on scroll is already fixed without this commit — it’s just a cleaner separation of concerns.