Fix pull-to-refresh so stale provider failures do not hide good usage#37
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 70c2d70a5e
ℹ️ 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".
| if hasCurrentPayload { | ||
| errorMessage = nil | ||
| await fetchDaemonStatus() | ||
| return |
There was a problem hiding this comment.
Track payload by provider before suppressing refresh errors
This branch suppresses errors whenever any in-memory payload exists, but usageJSON is a single shared value and not tied to selectedProvider. After switching from Codex to Claude, if the Claude request fails, hasCurrentPayload is still true from the prior Codex fetch, so the method returns with errorMessage = nil and leaves stale Codex metrics visible under Claude-selected UI labels. This is a regression from the previous behavior (showing an unreachable-server error) and can mislead users with wrong-provider usage data.
Useful? React with 👍 / 👎.
Summary
Testing
xcodebuild build-for-testingpassed for the iOS app target.