Skip to content

Fix vault balance changes table not loading due to WASM race condition#2443

Open
findolor wants to merge 2 commits intov4from
2026-02-09-fix-vault-balance-changes-race-condition
Open

Fix vault balance changes table not loading due to WASM race condition#2443
findolor wants to merge 2 commits intov4from
2026-02-09-fix-vault-balance-changes-race-condition

Conversation

@findolor
Copy link
Collaborator

@findolor findolor commented Feb 9, 2026

Motivation

The vault balance changes table on the vault details page was not loading any data. Both VaultBalanceChart and VaultBalanceChangesTable were independently calling vault.getBalanceChanges(1) simultaneously on mount, causing a race condition in the WASM layer where one call would return empty results while the other succeeded.

Solution

Lift the balance changes data fetch into VaultDetail as a single createQuery, making it the single source of truth. Both child components become pure display components:

  • VaultBalanceChart — receives the query as a prop instead of creating its own
  • VaultBalanceChangesTable — receives the data array as a prop, renders directly without createInfiniteQuery or TanstackAppTable
  • VaultDetail — owns the createQuery for balance changes, passes query to chart and data to table

This eliminates the concurrent WASM call and simplifies the component architecture.

Checks

By submitting this for review, I'm confirming I've done the following:

  • made this PR as small as possible
  • unit-tested any new functionality
  • linked any relevant issues or PRs
  • included screenshots (if this involves a front-end change)

Both VaultBalanceChart and VaultBalanceChangesTable were independently
calling vault.getBalanceChanges(1) simultaneously, causing a race
condition in the WASM layer where one call would return empty results.

Lift the balance changes fetch to VaultDetail as a single source of
truth and pass data down to both child components, making them pure
display components.
@findolor findolor self-assigned this Feb 9, 2026
@findolor findolor requested a review from hardyjosh February 9, 2026 13:16
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 9, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 2026-02-09-fix-vault-balance-changes-race-condition

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@findolor findolor force-pushed the 2026-02-09-fix-vault-balance-changes-race-condition branch from a8de116 to 34a71b1 Compare February 9, 2026 14:13
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