QR save dialogs can outlive their wallet or payment request #1013

Closed
opened 2026-10-15 01:09:49 +00:00 by jarolrod · 2 comments
jarolrod commented 2026-10-15 01:09:49 +00:00 (Migrated from github.com)

There are two cases here: a receiving-address QR save can export another wallet’s address, and a payment-request QR save can silently produce no file. Both leave a native Save dialog usable after the context it was opened for has changed.

These were originally reported under #992.

Receiving-address QR: saves the wrong wallet’s address

  1. Load regtest wallets A and B.
  2. Visit Receive in B and wait for its address and QR to load.
  3. Switch to A, open Receive, and note its address.
  4. Choose Save QR code and leave the native Save dialog open.
  5. Through the GUI’s RPC server, run unloadwallet "A" false. B becomes selected.
  6. Accept Save, then decode the PNG.

The PNG contains B’s address. I confirmed B owns it with getaddressinfo.

Visiting B’s Receive page first matters: a fresh address-generation signal can close the dialog and hide this case.

Payment-request QR: Save silently writes nothing

  1. Load A and B, with A selected.
  2. Create a payment request in A and leave its modal open with the QR loaded.
  3. Choose More → Save QR code.
  4. While the native Save dialog is open, run unloadwallet "A" false through the GUI’s RPC server.
  5. Wait for the request modal to close, then save to a valid writable destination.

The picker closes, but there’s no PNG and no error. I also reproduced this by loading B through RPC while A’s picker was open.

We should close and invalidate these dialogs when their wallet/request changes or the owning view closes. An accepted save shouldn’t pick up another wallet’s QR or silently do nothing.

Tested with native dialogs on macOS / Qt 6.9.0 at b03cf0554841. The wrong-address case also reproduces on parent 77e8005455cd; I only tested the silent-save case on the PR build.

Original reports: wrong address, silent save. Related QR work: #972 and #990.

There are two cases here: a receiving-address QR save can export another wallet’s address, and a payment-request QR save can silently produce no file. Both leave a native Save dialog usable after the context it was opened for has changed. These were originally reported under [#992](https://github.com/bitcoin-core/gui-qml/issues/992). **Receiving-address QR: saves the wrong wallet’s address** 1. Load regtest wallets A and B. 2. Visit Receive in B and wait for its address and QR to load. 3. Switch to A, open Receive, and note its address. 4. Choose Save QR code and leave the native Save dialog open. 5. Through the GUI’s RPC server, run `unloadwallet "A" false`. B becomes selected. 6. Accept Save, then decode the PNG. The PNG contains B’s address. I confirmed B owns it with `getaddressinfo`. Visiting B’s Receive page first matters: a fresh address-generation signal can close the dialog and hide this case. **Payment-request QR: Save silently writes nothing** 1. Load A and B, with A selected. 2. Create a payment request in A and leave its modal open with the QR loaded. 3. Choose More → Save QR code. 4. While the native Save dialog is open, run `unloadwallet "A" false` through the GUI’s RPC server. 5. Wait for the request modal to close, then save to a valid writable destination. The picker closes, but there’s no PNG and no error. I also reproduced this by loading B through RPC while A’s picker was open. We should close and invalidate these dialogs when their wallet/request changes or the owning view closes. An accepted save shouldn’t pick up another wallet’s QR or silently do nothing. Tested with native dialogs on macOS / Qt 6.9.0 at `b03cf0554841`. The wrong-address case also reproduces on parent `77e8005455cd`; I only tested the silent-save case on the PR build. Original reports: [wrong address](https://github.com/bitcoin-core/gui-qml/issues/992#issuecomment-6162087442), [silent save](https://github.com/bitcoin-core/gui-qml/issues/992#issuecomment-6162087813). Related QR work: [#972](https://github.com/bitcoin-core/gui-qml/issues/972) and [#990](https://github.com/bitcoin-core/gui-qml/pull/990).
jarolrod commented 2026-10-16 04:21:05 +00:00 (Migrated from github.com)

Found another way to hit the silent save here, without switching or unloading wallets.

  1. Load regtest wallets A and B, with spendable funds in A.
  2. In B, create a payment request and choose More → Save QR code.
  3. Leave the native Save dialog open and send 0.001 BTC to the request’s address from A through the GUI node’s RPC.
  4. Once the payment is detected, accept Save to a writable destination.

The request changes to “Payment received,” but the Save dialog stays open. Clicking Save closes it without creating a PNG or showing an error.

Reproduced twice on qt6 at d567e3eb2497, native macOS / Qt 6.9.0. The same request exported successfully before payment, to the same folder.

Once paid, captureQR() returns false because sharing is disabled, and the acceptance handler ignores that result. There’s already cleanup intended to close the dialog when payment arrives, but it didn’t happen in these runs. We should cover this transition in the fix too.

Found another way to hit the silent save here, without switching or unloading wallets. 1. Load regtest wallets A and B, with spendable funds in A. 2. In B, create a payment request and choose More → Save QR code. 3. Leave the native Save dialog open and send 0.001 BTC to the request’s address from A through the GUI node’s RPC. 4. Once the payment is detected, accept Save to a writable destination. The request changes to “Payment received,” but the Save dialog stays open. Clicking Save closes it without creating a PNG or showing an error. Reproduced twice on `qt6` at `d567e3eb2497`, native macOS / Qt 6.9.0. The same request exported successfully before payment, to the same folder. Once paid, `captureQR()` returns false because sharing is disabled, and the acceptance handler ignores that result. There’s already cleanup intended to close the dialog when payment arrives, but it didn’t happen in these runs. We should cover this transition in the fix too.
pseudoramdom commented 2026-10-16 04:43:06 +00:00 (Migrated from github.com)

I'll take this

I'll take this
Sign in to join this conversation.
No description provided.