fix: sync desktop rewards gift balance from cloud credits#922
fix: sync desktop rewards gift balance from cloud credits#922
Conversation
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7b8fec2e9f
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f55b784276
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ab31a2d3ea
ℹ️ 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".
What
Use the cloud credits summary as the source of truth for desktop rewards gift balance, and show that value in the workspace sidebar.
Why
The desktop rewards UI could show an incorrect gift balance because it relied on rewards status data that does not carry the full credit balance shape. This keeps the displayed balance aligned with the cloud credits API and preserves a usable fallback when rewards status cannot be fetched.
How
/api/v1/credits/summaryalongside rewards status and reward claim flows, then map itsbalancepayload into desktop rewards statusgiftBalanceis available end to end, while preserving fallback behavior when the credits summary call failsgiftBalancefromcloudBalance, add focused tests, and reset the local profileauthSourcewhen switching cloud profilesAffected areas
Checklist
pnpm typecheckpassespnpm lintpassespnpm testpassespnpm generate-typesrun (if API routes/schemas changed)anytypes introduced (useunknownwith narrowing)