Skip to content

Conversation

@Overtorment
Copy link
Member

@Overtorment Overtorment commented Nov 17, 2025

Note

TransactionStatus now uses useWalletSubscribe to reactively update the transaction/wallet and includes a unit test verifying re-fetch on wallet changes.

  • Transactions UI:
    • Switch screen/transactions/TransactionStatus.tsx to use useWalletSubscribe(walletID) for reactive wallet/tx updates.
    • Replace manual wallet lookup and effects to derive tx from subscribedWallet.getTransactions() and set wallet from subscribedWallet.
    • Update effect dependencies from wallet to subscribedWallet to reflect live changes (e.g., confirmations).
  • Tests:
    • Add tests/unit/transaction-status.test.tsx regression test to assert re-fetching transactions and confirmation updates when lastTxFetch changes.

Written by Cursor Bugbot for commit 0fb0969. This will update automatically on new commits. Configure here.

anabelle and others added 6 commits November 10, 2025 19:49
- Cache wallet last fetch timestamp with useMemo to avoid redundant reads
- Trigger transaction data reload when fetch timestamp advances
- Add regression unit test covering confirmation refresh behaviour
Address review feedback by using the existing useWalletSubscribe hook
instead of manually memoizing getLastTxFetch(). The hook was specifically
designed to provide automatic wallet updates when transactions change.

Changes:
- Import and use useWalletSubscribe(walletID) to get subscribedWallet
- Replace wallet state setter to use subscribedWallet instead of finding from wallets array
- Replace transaction sync effect to use subscribedWallet and remove lastTxFetch dependency
- Update test to mock useWalletSubscribe hook

The hook polls getLastTxFetch() every second internally and returns a
proxied wallet that triggers re-renders when changes are detected.
The test was failing because useWalletSubscribe returns a new proxied
wallet when lastTxFetch changes. Updated the mock to create a new Proxy
instance when the update function changes lastTxFetch, simulating the
hook's behavior.
…b.com:anabelle/BlueWallet into anabelle-fix/transaction-status-update-on-confirmation
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Wallet Updates Fail to Refresh Button States

The initialButtonsState effect uses wallet from component state but only depends on [tx, wallets]. When subscribedWallet updates (triggering a state update of wallet), the effect won't re-run because the storage wallets hasn't changed. This prevents button state (CPFP, RBF) from being calculated when the wallet becomes available. The dependency should include wallet or reference the factor that triggers wallet updates.

screen/transactions/TransactionStatus.tsx#L306-L311

subscription.remove();
clearInterval(fetchTxInterval.current);
fetchTxInterval.current = undefined;
};
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);

Fix in Cursor Fix in Web


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants