Skip to content

Conversation

@johnnyreilly
Copy link
Contributor

@johnnyreilly johnnyreilly commented Feb 8, 2026

Resolves: #1174

This is a speculative PR which changes the approach to surface an explicit "Hit npm rate limit, try again in a moment" message when 429s happen. I wondered if this would be useful?

image

No worries if it's not - but I thought I'd share the idea! This doesn't contain all i18n locales. If the approach is helpful I think with AIs help I can probably provide that.

PS first time doing any Vue / Nuxt - please bear with my mistakes!

@vercel
Copy link

vercel bot commented Feb 8, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
npmx.dev Ready Ready Preview, Comment Feb 8, 2026 9:49am
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs.npmx.dev Ignored Ignored Preview Feb 8, 2026 9:49am
npmx-lunaria Ignored Ignored Feb 8, 2026 9:49am

Request Review

@github-actions
Copy link

github-actions bot commented Feb 8, 2026

Lunaria Status Overview

🌕 This pull request will trigger status changes.

Learn more

By default, every PR changing files present in the Lunaria configuration's files property will be considered and trigger status changes accordingly.

You can change this by adding one of the keywords present in the ignoreKeywords property in your Lunaria configuration file in the PR's title (ignoring all files) or by including a tracker directive in the merged commit's description.

Tracked Files

File Note
lunaria/files/en-GB.json Localization changed, will be marked as complete.
lunaria/files/en-US.json Source changed, localizations will be marked as outdated.
Warnings reference
Icon Description
🔄️ The source for this localization has been updated since the creation of this pull request, make sure all changes in the source have been applied.

@codecov
Copy link

codecov bot commented Feb 8, 2026

Codecov Report

❌ Patch coverage is 30.43478% with 16 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
app/composables/npm/useNpmSearch.ts 30.43% 11 Missing and 5 partials ⚠️

📢 Thoughts on this report? Let us know!

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 8, 2026

📝 Walkthrough

Walkthrough

This PR implements rate-limit handling for npm searches. The useNpmSearch composable now detects and handles HTTP 429 rate-limit errors by introducing an isRateLimited reactive flag, catching errors during fetch operations, and resetting the flag on successful searches or empty queries. The search page component uses this flag to display a rate-limit message instead of search results. Translations for the rate-limit notification have been added across multiple locale files.

Possibly related PRs

Suggested reviewers

  • danielroe
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The PR successfully addresses issue #1174 by implementing rate-limit detection in useNpmSearch, surfacing an explicit message to users when 429 errors occur, and improving UX during rate-limiting scenarios.
Out of Scope Changes check ✅ Passed All changes are directly scoped to resolving the rate-limit issue: composable logic, UI conditional rendering, and i18n translations for the rate-limit message. No unrelated modifications detected.
Description check ✅ Passed The pull request description directly relates to the changeset, referencing issue #1174 and explaining the implementation of an explicit rate-limit message UI.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Comment @coderabbitai help to get the list of available commands and usage tips.

@danielroe danielroe added this pull request to the merge queue Feb 8, 2026
@danielroe
Copy link
Member

thank you ❤️

Merged via the queue into npmx-dev:main with commit 13ef534 Feb 8, 2026
18 checks passed
@github-actions
Copy link

github-actions bot commented Feb 8, 2026

Thanks for your first contribution, @johnnyreilly! 💫

We'd love to welcome you to the npmx community. Come and say hi on Discord! And once you've joined, visit npmx.wamellow.com to claim the contributor role.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Search results not appearing due to rate limiting / 429s

2 participants