Skip to content

docs: re-attach the orphaned _createRateLimitError JSDoc - #2023

Closed
dj-jarvis wants to merge 1 commit into
ProjectOpenSea:mainfrom
dj-jarvis:fix/orphaned-rate-limit-error-jsdoc
Closed

dj-jarvis wants to merge 1 commit into
ProjectOpenSea:mainfrom
dj-jarvis:fix/orphaned-rate-limit-error-jsdoc

Conversation

@dj-jarvis

Copy link
Copy Markdown

What

_createRateLimitError had no documentation. Its JSDoc block had ended up
orphaned directly above _createApiError, separated from it by nothing but a
blank line.

/**
 * Creates a rate limit error with status code and retry-after information.
 * ...
 */
/**                                     ← only this one attaches
 * Builds an error carrying the HTTP status. ...
 */
private static _createApiError(...)

private async _createRateLimitError(...)   // ← undocumented

Why it's a bug

Two adjacent JSDoc blocks: TypeScript, IDEs and typedoc attach only the last
one to a symbol. So the first block was dead text in the source — it describes
_createRateLimitError while sitting above a method it says nothing about — and
_createRateLimitError was left with no documentation at all.

That method builds the OpenSeaRateLimitError that executeWithRateLimit in
src/utils/rateLimit.ts reads to decide whether a 429/599 is retryable, so its
documented contract (statusCode, retryAfter, responseBody) is exactly what
a reader needs and cannot find.

Most likely fallout of 59b7337 ("Attach statusCode to every error thrown for a
non-OK API response"), which added _createApiError with a new block without
removing the old one.

Fix

Move the orphaned block back onto the method it describes. Comment-only — no
behavior change.

@ryanio

ryanio commented Oct 6, 2026

Copy link
Copy Markdown
Collaborator

Thanks for catching this, the orphaned block was easy to miss. We've recreated the fix in our internal monorepo in ProjectOpenSea/opensea-devtools#789 (now merged), with you credited on the commit, and it will ship in the next SDK release.

This repo is a read-only mirror, so we can't merge PRs here, but we review every one. Appreciate it!

@ryanio ryanio closed this Oct 6, 2026
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.

2 participants