feat(slice-012): CoinGecko rate limiting#13
Merged
Conversation
- Add RateLimitError type with RetryAfter field - Add IsRateLimitError and RetryAfterFromError helpers - Add throttle mechanism to HTTPClient with 2s min interval - Add 429 detection in FetchMarkets and FetchPrices - Add comprehensive tests for throttling and rate limiting
- Add rateLimitedUntil and refreshAttempts fields to MarketsModel - Update errMsg handler to detect RateLimitError and apply exponential backoff - Block manual refresh (r key) when rate-limited - Block auto-refresh (tickMsg) when rate-limited - Reset backoff state on successful prices update - Update statusRight() to show rate-limited countdown - Update renderStatusBar() with dark orange style for rate-limited state - Add comprehensive tests for rate-limit state transitions
- Update roadmap: IN_PROGRESS -> IN_REVIEW - Update issue frontmatter: in_progress -> in_review
…lock and timer fire Closes finding I1 in docs/reviews/012-coingecko-rate-limiting/revision-1.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
internal/api/coingecko.go— minimum 2s gap between API calls, respecting context cancellationRetry-Afterheader into aRateLimitErrortype withIsRateLimitErrorandRetryAfterFromErrorhelpersrkey) to no-op when rate-limited or already refreshingRate limited — retry in XsTest Plan
make checkpasses (fmt, lint, test, vuln)Retry-Afterheader parsing tested viahttptest.NewServer