You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug: spark send shows failed at expiry, then pays #1463
A Spark Lightning send whose sendPayment call errored after the operators committed it can be reported as failed at its invoice's expiry, then settle as paid later. QuickPay and Paykit accounting for it is released by the failure.
Both apps end such a hold once the invoice expired and a sync past expiry reached Spark (lastSyncedAt after the expiry, no lastSyncError), and Spark's list shows no attempt of the send:
send_payment writes the send's payment row only after the SSP call returns Ok (crates/breez-sdk/core/src/sdk/lightning_sender.rs, pay_and_persist_lightning_invoice and payment_from_pay_result). When it errors, only a pending-send cache entry is kept.
The row then appears through resume_pending_sends, which logs and swallows its errors, or through the payment-history import (sync_wallet_state_to_storage).
last_synced_at is set when spark_wallet.sync() succeeds, whatever the import's result (crates/breez-sdk/core/src/sdk/sync.rs, sync_wallet_internal). last_sync_error also reflects only the wallet sync, and the public Synced event carries no per-step result.
So a sync whose wallet step succeeded but whose resume and import failed advances lastSyncedAt, while the send still has no row. The apps can't tell that sync apart from a complete one.
Fix
This needs a signal from the SDK: the payment-history import's result in getInfo or the Synced event, or last_synced_at set only when the import succeeded. Once one exists, both apps end the hold only after a sync whose import succeeded.
The window is one sync past the invoice's expiry in which the wallet sync succeeds and the import fails.
Activity