Anabelle fix transaction status update on confirmation#8172
Closed
Overtorment wants to merge 6 commits into
Closed
Anabelle fix transaction status update on confirmation#8172Overtorment wants to merge 6 commits into
Overtorment wants to merge 6 commits into
Conversation
- 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
There was a problem hiding this comment.
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
BlueWallet/screen/transactions/TransactionStatus.tsx
Lines 306 to 311 in 0fb0969
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
TransactionStatusnow usesuseWalletSubscribeto reactively update the transaction/wallet and includes a unit test verifying re-fetch on wallet changes.screen/transactions/TransactionStatus.tsxto useuseWalletSubscribe(walletID)for reactive wallet/tx updates.txfromsubscribedWallet.getTransactions()and setwalletfromsubscribedWallet.wallettosubscribedWalletto reflect live changes (e.g., confirmations).tests/unit/transaction-status.test.tsxregression test to assert re-fetching transactions and confirmation updates whenlastTxFetchchanges.Written by Cursor Bugbot for commit 0fb0969. This will update automatically on new commits. Configure here.