fix(rate-limit): fixes footer display and tracks GraphQL cost#80
Merged
wgordon17 merged 7 commits intoApr 23, 2026
Merged
Conversation
- Gate updateRateLimitFromHeaders on !isGraphql to prevent GraphQL response headers from contaminating _coreRateLimit signal - Add GraphQL-aware signal updates to hook.wrap error path: routes GraphQL errors to _setGraphqlRateLimit, REST errors to updateRateLimitFromHeaders, wrapped in try/catch to never mask errors - Make fetchRateLimitDetails() update both signals on all return paths (cache-hit and fresh-fetch) - Add tests for signal routing, error path updates, and fetchRateLimitDetails signal feedback
- Call fetchRateLimitDetails() after setIsRefreshing(true) to seed both rate limit signals with authoritative GET /rate_limit data - Add github module mock to poll tests for fetchRateLimitDetails - Add flushPromises helper for multi-await microtask flushing
- runForkPRFallback: extract rateLimit from err.data before partialData - fetchPREnrichment: extract rateLimit at start of catch block - fetchHotPRStatus: extract from s.reason.data in rejection loop - Add tests for all three error-path extractions
- Three-tier CSS class: text-error at remaining===0, text-warning at <10%, normal otherwise - Add DashboardPage.test.tsx with tests for all three styling states
- NaN-guard parseInt(remaining) in error-path signal update - Remove redundant signal updates from fetchRateLimitDetails cache hit path (signals already set on fresh fetch) - Add explanatory comment to flushPromises test helper
- Adds cost field to all 7 GraphQL rateLimit query fragments - Extracts rateLimit.cost from GraphQL response body in hook.wrap - Extracts cost from error response body on GraphQL failures - Passes graphqlCost via ApiRequestInfo to api-usage tracking - Renames Settings UI labels from Calls/counts to Usage - Add tests for graphqlCost extraction in hook.wrap callbacks
- Restore cache-hit signal updates in fetchRateLimitDetails - Extract rateLimitCssClass utility from inline ternary - Run fetchRateLimitDetails concurrently (void, not await) - Add error-path graphqlCost and call-count tests - Add fetchRateLimitDetails signal update + cache-hit tests - Fix section comment numbering cascade in SettingsPage - Add clientOverride param to fetchRateLimitDetails for testability
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
Closes #79