Review report

bitcoin-core/gui-qml: PR #1049

2 minor findings · 2 suggestions

Findings

Link

[minor] · Hiding Send dismisses completion without clearing the sent draft

Navigating away while the send-completion screen is open now closes it without resetting the form, leaving the sent recipients and amounts available for another explicitly confirmed payment.

Location: qml/pages/wallet/WalletView.qml:194 (head).

Details and suggested fix

When navigation hides Send after a successful send, the new visibility handler calls pageHidden(sendPage) and closes transactionReviewPopup. Its onClosed handler pops the review stack but does not call resetSendForm(). That reset exists only in the completion page's Done and View transaction handlers, and successful backend sending clears selected coins rather than recipients. Returning to Send therefore restores the sent payment's form and loses the completion screen's View transaction action. A duplicate payment still requires sufficient funds and another review and explicit send. This newly affects same-wallet navigation; wallet switching already had the cleanup omission at base. Native View-menu commands route to Activity or Node without checking popup state, although their usability during the modal popup has not been interactively confirmed. Reset the sent draft when sending succeeds, rather than relying exclusively on the completion buttons. Add a regression that completes a send, calls openActivity() or openNode(), returns to Send, and checks that recipients were cleared.


Link

[minor] · MainRouting lacks the open-wallet fixture needed for focused runs

Running MainRouting alone leaves the mock's new open-wallet list empty, so wallet-tab and creation-completion routing tests depend on state left by another test file.

Location: test/qml/qml_tests_main.cpp:1842 (head).

Details and suggested fix

createMain() resets the mock and sets its loaded state, but never calls setOpenWallets(). The static mock controller starts with an empty list; selecting a wallet, setting it loaded, and emitting mock creation success do not add it. DesktopWallets therefore creates no WalletView, and openSend() becomes a no-op. In test_view_menu_commands_select_wallet_tabs, the assertion that Send is checked after leaving Node consequently cannot pass in an isolated run. The missing view also prevents finding sendNoteInput, and openWallet() rejects creation-completion routing because the wallet is absent from the list. Earlier tests such as DesktopWallets populate the retained mock list and can mask this fixture omission. Initialize both openWallets and the selected wallet in createMain(), using an empty list for no-wallet cases and explicitly adding the wallet when those cases simulate successful creation.


Optional improvements

Link

[suggestion] · Fee bumping and message signing omit the closing-wallet gate

Before queued unload cleanup detaches their wallet pointers, fee bumping and message signing can still execute user-confirmed actions even though the new availability flag already rejects other wallet operations.

Location: qml/models/walletqmlmodel.h:222 (head).

Details and suggested fix

BumpTransactionModel::confirmFeeBumpInternal() checks its wallet pointer and confirmation state, while SignVerifyMessageModel::signMessageInternal() checks its wallet pointer and signing requirements. Neither consults m_unload_requested. Their pointers remain attached until beginShutdown(), after the queued unload notification reaches the controller. A valid action submitted in that interval can therefore sign a message or sign and commit a fee bump despite available() already being false. This capability existed before the PR, and the action still requires the user's confirmation and any necessary password for the same wallet; it is an incomplete extension of the new closing-wallet rule, not an authorization bypass. Pass the shared atomic flag or an availability callback into both models and reject fee-bump preparation, confirmation, and message signing with the closing-wallet error. Keep QObject access on the GUI thread rather than detaching these models from the backend callback.


Link

[suggestion] · Unvisited startup wallets allocate full page sets

Eager creation charges every startup-loaded wallet the PR's reported roughly 45 MB view cost, even if never shown; first-use creation followed by retention would preserve isolation and visited-wallet state.

Location: qml/pages/wallet/DesktopWallets.qml:50 (head).

Details and suggested fix

syncOpenWallets() adds every available wallet to the Repeater, whereas startup initialization selects only m_wallets.front(). Consider creating each wallet's view when first shown, then retaining it until close or unload. Unlike keeping only the currently shown view, this preserves the immutable wallet association, tabs, drafts, and navigation for every visited wallet, and still permits additional views to be created for future side-by-side use. The saving applies to unvisited startup wallets: GUI and RPC loads auto-select their wallet and would create a view anyway. Preserve targeted requests for never-shown wallets and replay them when their view is created, since they currently update hidden views. This avoids the reported per-view memory cost and construction work for unused startup wallets without discarding state that the user has already established.


Coverage details