Skip to content

fix: refresh portfolio balances without hard reload#1187

Merged
w84april merged 3 commits intorelease/26-04-17from
fix/portfolio-balance-refresh
May 4, 2026
Merged

fix: refresh portfolio balances without hard reload#1187
w84april merged 3 commits intorelease/26-04-17from
fix/portfolio-balance-refresh

Conversation

@rossgalloway
Copy link
Copy Markdown
Collaborator

@rossgalloway rossgalloway commented Apr 15, 2026

Summary

  • disable caching for the Enso balances endpoint in both API entrypoints
  • opt the client-side Enso balances fetch out of browser cache reuse
  • refetch wallet balance queries whenever the app window regains focus
  • refetch wallet balances once when the portfolio route becomes active
  • add regression coverage for the Enso cache header, the wallet-balance focus refetch policy, and the portfolio-entry refresh policy

Context

This splits the portfolio freshness work out from the Safe/Katana overlay branch.

The reported symptom was that portfolio holdings could stay stale across normal reloads or tab switches, while a hard refresh fixed the issue. That pointed to cached balance responses and insufficient foreground refetch behavior.

Test Plan

  • bun run tslint
  • bun run lint:fix
  • bunx vitest run src/components/pages/portfolio/hooks/usePortfolioEntryRefresh.helpers.test.ts src/components/shared/hooks/balanceQueryConfig.test.ts src/components/shared/hooks/useBalancesQuery.test.ts src/components/shared/hooks/useBalancesQueries.test.ts api/enso/cache.test.ts

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 15, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
yearnfi Ready Ready Preview, Comment Apr 28, 2026 3:03pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
yearnfi-nextjs Ignored Ignored Preview Apr 28, 2026 3:03pm

Request Review

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 15, 2026

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@w84april w84april merged commit f753645 into release/26-04-17 May 4, 2026
10 checks passed
@w84april w84april deleted the fix/portfolio-balance-refresh branch May 4, 2026 13:03
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.

2 participants