Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

fix(x-search): retry on HTTP 429 using Retry-After or X-Rate-Limit-Reset#247

Open
fuleinist wants to merge 1 commit intovirattt:mainvirattt/dexter:mainfrom
fuleinist:fix/x-search-429-retryfuleinist/dexter:fix/x-search-429-retryCopy head branch name to clipboard
Open

fix(x-search): retry on HTTP 429 using Retry-After or X-Rate-Limit-Reset#247
fuleinist wants to merge 1 commit intovirattt:mainvirattt/dexter:mainfrom
fuleinist:fix/x-search-429-retryfuleinist/dexter:fix/x-search-429-retryCopy head branch name to clipboard

Conversation

@fuleinist
Copy link
Copy Markdown

Fix: x-search.ts retries on HTTP 429 instead of aborting

Issue: #246

Problem

Multi-page X searches aborted mid-run when the API returned HTTP 429. The code read X-Rate-Limit-Reset but still threw immediately, losing all progress.

Fix

xApiGet() now retries once after waiting for reset:

  • Retry-After header (preferred — explicit wait time from the API)
  • X-Rate-Limit-Reset (fallback — unix timestamp converted to seconds)
  • 60s default (if neither header is present)

Only the rate-limited request is retried — pagination state is preserved so multi-page search resumes from the next page after the wait.

Verification

npm test passes (existing test suite).

Before: 429 response threw immediately, losing multi-page search progress.
After: 429 triggers retry after waiting for reset time. Honours Retry-After
header when present; falls back to X-Rate-Limit-Reset; defaults to 60s.

Preserves pagination state — only the rate-limited request is retried,
not the entire search run.
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.

1 participant

Morty Proxy This is a proxified and sanitized view of the page, visit original site.