Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ea8c620be5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
ea8c620 to
6fdde05
Compare
6fdde05 to
a8ebc62
Compare
1e570d8 to
3b79cde
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
| setErrorMessage(lstrings.error_data_unavailable) | ||
| } | ||
| break | ||
| } while (true) |
There was a problem hiding this comment.
Unbounded retry loop on 429 can spin forever
High Severity
The do...while(true) loop retries indefinitely on HTTP 429 responses with no maxRetries counter or exit condition beyond eventual success. If the API keeps rate-limiting, the loop never exits, setIsFetching(false) in the outer finally is never reached, and the user sees a permanent loading spinner. The PR discussion states that maxRetries (increased from 3 to 5) and exponential backoff were added, but neither is present in the code. The codebase already has a bounded retry pattern in FirstOpenActions.tsx using a for loop with maxRetries.
Additional Locations (1)
| // Wait 2 seconds before retrying. It typically takes 1 minute | ||
| // before rate limiting is relieved, so even 2 seconds is hasty. | ||
| await snooze(2000) | ||
| continue |
There was a problem hiding this comment.
Duplicate 429 retry logic may drift
Low Severity
Two nearly identical blocks handle 429 retries — one for the HTTP status code (before JSON parsing) and one for the JSON body error code (after parsing). Both perform the same pro-URL fallback check, snooze(2000), and continue. If future changes update one block (e.g., adding a retry counter or exponential backoff), the other could easily be missed, leading to inconsistent retry behavior.


CHANGELOG
Does this branch warrant an entry to the CHANGELOG?
Dependencies
none
Description
Context
The
SwipeChartcomponent fetches market data from CoinGecko API and has insufficient error handling for network failures and rate-limiting scenarios. When rate limits or HTTP errors occur, the error handling is ambiguous and can fail silently, making debugging difficult.Changes
response.okbefore parsing JSON to catch non-2xx status codes earlysetIsFetching(false)is always called via finally blockThese changes make the component more resilient to API failures and easier to debug when issues occur.
Requirements
If you have made any visual changes to the GUI. Make sure you have:
Note
Low Risk
Localized UI data-fetch error-handling and lint config tweak; minimal behavioral risk beyond how chart errors/retries are surfaced.
Overview
Improves
SwipeChartmarket-data fetching resilience by validatingresponse.ok, explicitly handling HTTP 429 rate limits (including retry + pro-key fallback), and safely parsing JSON viatext()with clearer error messages.Ensures
setIsFetching(false)always runs via afinally, and updates lint config to stop excludingSwipeChart.tsxfrom linting; adds a matching CHANGELOG entry.Written by Cursor Bugbot for commit 3b79cde. This will update automatically on new commits. Configure here.