Skip to content

fix: respect forceRefresh in balance fetch deduplication#36

Merged
BitHighlander merged 2 commits intodevelopfrom
bugfix/balance-fetch-race
Apr 5, 2026
Merged

fix: respect forceRefresh in balance fetch deduplication#36
BitHighlander merged 2 commits intodevelopfrom
bugfix/balance-fetch-race

Conversation

@BitHighlander
Copy link
Copy Markdown
Collaborator

Summary

  • fetchBalancesFromPioneer(forceRefresh=true) no longer returns stale in-progress promise
  • Dedup check is skipped when force refresh is explicitly requested

Test plan

  • Trigger manual balance refresh, verify it fetches new data even if a fetch was in progress

🤖 Generated with Claude Code

BitHighlander and others added 2 commits April 3, 2026 16:02
Previously, fetchBalancesFromPioneer(forceRefresh=true) would return
the existing in-progress promise, ignoring the force flag. Now the
dedup check is skipped when forceRefresh is requested.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When a forceRefresh call bypasses dedup while a prior fetch is still
in-flight, both promises run concurrently. The older promise's finally
would null out balancesFetchInProgress even after the newer force-refresh
promise had replaced it, causing subsequent callers to miss the in-flight
force fetch and spawn redundant RPC calls.

Fix by only clearing the ref when it still points to this promise.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@BitHighlander BitHighlander merged commit 54cb208 into develop Apr 5, 2026
3 of 4 checks passed
BitHighlander added a commit that referenced this pull request Apr 5, 2026
Ships 5 merged bug-fix PRs: vault messaging (#34), content-ui bar
removal (#33), balance forceRefresh dedup (#36), 8 EVM handler fixes
(#35), 7 Solana handler fixes (#37).

Co-Authored-By: Claude Opus 4.6 (1M context) <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