Skip to content

fix: surfacing 429s as not found to users - #1200

Merged
danielroe merged 1 commit into
npmx-dev:mainfrom
johnnyreilly:rate-limit-ui
Feb 8, 2026
Merged

fix: surfacing 429s as not found to users#1200
danielroe merged 1 commit into
npmx-dev:mainfrom
johnnyreilly:rate-limit-ui

Conversation

@johnnyreilly

@johnnyreillyjohnnyreilly commented Feb 8, 2026

Copy link
Copy Markdown
Contributor

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

vercelBot commented Feb 8, 2026

Copy link
Copy Markdown
Contributor

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

ProjectDeploymentActionsUpdated (UTC)
npmx.devReadyReadyPreview, CommentFeb 8, 2026 9:49am
2 Skipped Deployments
ProjectDeploymentActionsUpdated (UTC)
docs.npmx.devIgnoredIgnoredPreviewFeb 8, 2026 9:49am
npmx-lunariaIgnoredIgnoredFeb 8, 2026 9:49am

Request Review

@github-actions

Copy link
Copy Markdown

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

FileNote
lunaria/files/en-GB.jsonLocalization changed, will be marked as complete.
lunaria/files/en-US.jsonSource changed, localizations will be marked as outdated.
Warnings reference
IconDescription
🔄️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

codecovBot commented Feb 8, 2026

Copy link
Copy Markdown

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 linesPatch %Lines
app/composables/npm/useNpmSearch.ts30.43%11 Missing and 5 partials ⚠️

📢 Thoughts on this report? Let us know!

@coderabbitai

coderabbitaiBot commented Feb 8, 2026

Copy link
Copy Markdown
Contributor
📝 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 nameStatusExplanation
Linked Issues check✅ PassedThe 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✅ PassedAll 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✅ PassedThe 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 queueFeb 8, 2026
@danielroe

Copy link
Copy Markdown
Member

thank you ❤️

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

Copy link
Copy Markdown

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 freeto 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

@johnnyreilly@danielroe