fix(wallet): gate the received-payment toast on status, not absent pending #169

Merged
padreug merged 1 commit from fix/wallet-payment-toast-guard into dev 2026-09-22 21:16:07 +00:00

1 commit

Author SHA1 Message Date
18304984ce fix(wallet): gate the received-payment toast on status, not absent pending
Last remaining reader of the phantom `pending` field, same root cause as
#161: it is a pydantic `@property` and never appears in the payload, so
`!payment.pending` was always true. The guard reduced to `amount > 0`
alone and never actually suppressed an unsettled payment, which is what
it was there to do. Now checks `status === 'success'`.

The nested `else` that toasted "Sent N sats" was unreachable: the
enclosing condition already required `amount > 0`. Dropped rather than
repaired, because a send made from this app is already confirmed by
SendDialog's own success toast and re-announcing it here would double
up. An outgoing payment made from another client on the same wallet
still lands in the history list; it just does not raise a toast.

Verified against a live settled payment over the websocket:

  amount=44000  status=success  pending key present=False

Found while checking that the six merged wallet PRs behaved correctly
together.
2026-09-22 23:11:25 +02:00