Files
CatoandClaude Opus 5.5 9f27f996d0 fix(payments): a timed-out send is recorded as unconfirmed, not failed (#1269)
#1240 wrote a PAYMENT_SEND_FAILED audit row for every send the wallet
rejected. #1249 then made a timeout read "unconfirmed — it may still go
through" on screen, because a retry mints a new invoice and pays twice. The
two met in payOverNwc with the record written BEFORE the timeout check, so
the screen said "may have paid" while the record said "failed".

The outcome is now classified first and written as it is:
- timeout -> PAYMENT_SEND_UNCONFIRMED with success = null (unknown);
- any other rejection -> PAYMENT_SEND_FAILED with success = false.

auditLog wrote `entry.success ?? true`, which turns an explicit null into
true, so "unknown" would have been stored as "succeeded". It now defaults
only an OMITTED outcome to true and keeps null.

Both guards proved by mutation: restoring `??` and logging timeouts as
FAILED each turn one new test red.

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-08 03:04:07 -07:00
..