fix: keep showing cached usage data on transient errors - #75
Open
KurtGood wants to merge 1 commit into
Open
Conversation
Previously any refresh error replaced the whole popover with a
full-screen error view, even though the last successful fetch was
still in memory (the menu bar icon kept rendering it). A brief 429
rate limit or network blip therefore looked like a hard failure.
- Show the full-screen error only when there is no cached data or
the error needs user action (unauthorized / session expired / no
credentials); other errors render the normal detail view with a
compact warning banner ("showing last fetched data") on top.
- Track error kind via DataRefreshManager.errorRequiresAuthAction
instead of string-matching the localized message, which only
worked in English and Chinese; the settings button in the error
view now appears for auth errors in every language.
- fetchClaudeOnly no longer clears cached usage data on failure,
matching the combined fetchUsage path.
- New error.showing_cached_data string in all 7 localizations.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Problem
When a refresh fails, the popover replaces everything with a full-screen error view — even though the last successful fetch is still in memory (the menu bar icon keeps rendering it). A brief 429 rate limit or a network blip therefore looks like a hard failure:
Fix
DataRefreshManager.errorRequiresAuthActionpublished flag instead of string-matching the localized message (error.contains("Authentication")), which only worked in English and Chinese — as a side effect, the Go to Settings button in the error view now appears for auth errors in every language.fetchClaudeOnlyno longer clears cached usage data on failure, matching the combinedfetchUsagepath (previously a failed single-provider refresh wiped the cache; a failed combined refresh kept it).error.showing_cached_datastring in all 7 localizations (en, de, fr, ja, ko, zh-Hans, zh-Hant) — non-English translations are machine-assisted, happy to adjust.Notes
swift testpasses (61 tests).🤖 Generated with Claude Code