WIP: qml: Hand payment URIs to the running instance

bitcoin-core/gui-qml: PR #988

2 minor findings · 1 suggestion

Findings

Link

[minor] · Incoming payment requests cancel native file choosers on other wallet pages

A handed-over URI can switch to Send while a wallet backup or Activity export chooser is open, cancelling that operation because the delivery gate only checks Qt Quick popups.

Location: qml/pages/MainWindow.qml:147 (head).

Details and suggested fix

With a loaded wallet and an otherwise idle Send form, modalPopupOpen() and canAcceptPaymentUri() allow delivery while an AppFileDialog is open. That chooser is a separate QFileDialog opened asynchronously, so it adds no child to Overlay.overlay and does not stop IPC processing. applyIncomingPaymentUri() selects Send, hiding the chooser's owning page. WalletView.pageHidden() then recursively closes its file dialogs, abandoning the backup or export before the user chooses a destination. Track outstanding AppFileDialog operations in the delivery gate and retry delivery when the last chooser finishes. Add a routing test that queues a URI during backup or export and verifies that the chooser and current tab remain unchanged until it closes.


Link

[minor] · A request delivered while the PSBT chooser is open is dropped after Apply

If a URI arrives during the PSBT chooser and the user imports a supported PSBT, the import clears the saved request but leaves its review open, so Apply silently dequeues it without populating the form.

Location: qml/pages/wallet/SendCreate.qml:147 (head).

Details and suggested fix

canAcceptPaymentRequest() omits psbtOpenDialog, and the native chooser is absent from the Quick overlay gate. The guard in openPsbtFileImport() protects only the opposite order. An incoming URI can therefore open its review while the chooser is already open. Accepting a supported PSBT calls m_send_recipients->clear(), whose currentRecipientChanged signal clears m_pendingPastedPaymentRequest without interrupting the delivered request or closing its review. After the transaction review closes, Apply on the remaining payment review finds a null result but still reports resolved, removing the URI from the queue. Include !psbtOpenDialog.visible in readiness and emit paymentRequestAcceptable() when the chooser finishes. If recipients are replaced during an incoming review, interrupt and close that review so the request remains queued. Cover this ordering in a test.


Optional improvements

Link

[suggestion] · Unconfirmed hand-offs are reported as definite failures

A reply timeout can be reported as failed delivery even though the request may still appear, encouraging a duplicate retry; no startup delay exceeding the ten-second reply timeout was measured.

Location: qml/bitcoin.cpp:464 (head).

Details and suggested fix

Every Failed result gets the outer message “Payment request could not be handed to the running instance”, including cases where only the acknowledgement is missing. The inner error says confirmation was not received, but does not explain that delivery remains possible. The receiver queues the batch before replying, and it can also process buffered data after a delayed startup because listen() precedes model construction and synchronous QML loading. Separate definite refusals from unconfirmed delivery in SendResult. For the latter, tell the user the request may still appear and to check the running window before reopening the link. Keep the no-resend behavior and update the error substring expected by single-instance Test 7.


Coverage details