Skip to content

Retry Spotify 429s with backoff before surfacing a rate-limit message #411

Description

@chiptus

Parent

#405

What to build

When the search-artist-links edge function's Spotify path gets rate-limited (429), it retries once or twice with backoff honoring the response's Retry-After header instead of failing immediately. If still rate-limited after retries, the client receives a distinguishable rate-limit error (with wait time) instead of the current generic Spotify search failed (${status}) message, so the Link Wizard can show "rate limited, try again in Ns."

Acceptance criteria

  • A retry-with-backoff helper: succeeds immediately on a non-429 or first-try success (no retry); on 429, retries honoring Retry-After; after exhausting retries, returns a distinguishable rate-limit result carrying the wait time.
  • Non-429 errors are not retried and fail immediately as today.
  • The Link Wizard UI shows a clear "rate limited, try again in Ns" message when this error is surfaced, instead of the generic failure message.
  • SoundCloud's existing 429 handling is unchanged (out of scope here).

Blocked by

None (can start immediately)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions