Skip to content

fix: keep showing cached usage data on transient errors - #75

Open
KurtGood wants to merge 1 commit into
f-is-h:mainfrom
KurtGood:fix/stale-data-on-error
Open

fix: keep showing cached usage data on transient errors#75
KurtGood wants to merge 1 commit into
f-is-h:mainfrom
KurtGood:fix/stale-data-on-error

Conversation

@KurtGood

Copy link
Copy Markdown

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:

  • The full-screen error hides perfectly good cached data behind an orange triangle.
  • All errors get the same treatment: a transient rate limit renders identically to "no credentials configured".

Fix

  • 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 keep the normal detail view and add a compact warning banner at the top: the error text plus a "Showing last fetched data" note (hover shows the full error).
  • Track the error kind via a new DataRefreshManager.errorRequiresAuthAction published 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.
  • fetchClaudeOnly no longer clears cached usage data on failure, matching the combined fetchUsage path (previously a failed single-provider refresh wiped the cache; a failed combined refresh kept it).
  • New error.showing_cached_data string in all 7 localizations (en, de, fr, ja, ko, zh-Hans, zh-Hant) — non-English translations are machine-assisted, happy to adjust.

Notes

🤖 Generated with Claude Code

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant