Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThe user profile page's package listing logic is refactored to use the Changes
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 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 |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@app/pages/`~[username]/index.vue:
- Around line 40-41: The user page is reusing useOrgPackages(username) which
returns organisation-specific 404 semantics causing "~missing-user" to show org
wording; wrap or parameterise useOrgPackages so the user route normalises
not-found errors to user semantics: update the call in ~[username]/index.vue to
use a thin wrapper (e.g., fetchUserPackages or pass an option like {
normalizeNotFound: true }) that catches error responses from useOrgPackages and
maps organisation 404s to a standard user 404 (or rethrows a normalized
NotFoundError), and ensure the "~missing-user" path logic at the user page
consumes that normalized error instead of org-specific messages.
🪄 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: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 6edebd49-8496-4db6-86a3-bbceb4a7d03d
📒 Files selected for processing (1)
app/pages/~[username]/index.vue
app/pages/~[username]/index.vue
Outdated
| // Fetch packages — reuses the org endpoint which accepts usernames too | ||
| const { data: results, status, error } = useOrgPackages(username) |
There was a problem hiding this comment.
Normalise the not-found semantics before reusing useOrgPackages() here.
useOrgPackages() still throws organisation-specific 404s, so ~missing-user can now surface organisation wording on this user page at Line 175, and the server path can short-circuit into the global 404 flow. Please wrap or parameterise the shared composable so user profiles keep user-specific error handling instead of inheriting the org-page behaviour. As per coding guidelines: Use error handling patterns consistently.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@app/pages/`~[username]/index.vue around lines 40 - 41, The user page is
reusing useOrgPackages(username) which returns organisation-specific 404
semantics causing "~missing-user" to show org wording; wrap or parameterise
useOrgPackages so the user route normalises not-found errors to user semantics:
update the call in ~[username]/index.vue to use a thin wrapper (e.g.,
fetchUserPackages or pass an option like { normalizeNotFound: true }) that
catches error responses from useOrgPackages and maps organisation 404s to a
standard user 404 (or rethrows a normalized NotFoundError), and ensure the
"~missing-user" path logic at the user page consumes that normalized error
instead of org-specific messages.
fix: use dedicated useUserPackages composable with correct 404 handling
609b48f to
5069b13
Compare
fixes #2504
This PR reuses the org code to power the
useUserPackages.tshook.Why? well the endpoint to get packages for orgs also works for users, by design. So we can reuse the API w/o any loss of accuracy.
It's a dirty lil hack rn, just reuse that same hook. I spent enough time root causing this bug, so this is the short term fix that I prefer and prefer to have reviewed.Seeing the red checks made me come back and try to do this slightly cleaner lol. Now im jsut duplicatng the logic of the org hook whereas before I was using the org hook itself. It's messy.There is an existing bug btw on the Org pages, which is present in this PR as well. The org logic is limited to fetching 1k packages at once from npm, but there is no limit or pagination currently. See https://www.npmx.dev/~sindresorhus , on an empty cache that makes requests for every single one of his 1690 packages to fetch metadata as a fallback after the 400. Issue for that is #2507
Before 📸
After 📸