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
QuickPay keeps the daily spend reserved when Spark refuses before dispatch #2161
If Spark refuses a QuickPay payment before anything is sent, QuickPay keeps that amount counted against the daily limit until the next day. Rescanning the same invoice also shows Pending instead of retrying.
Trigger
QuickPay pays a bolt11 invoice over Spark, and SparkRepo.payInvoice throws SparkError.SendRefused before onBeforeSend() runs. Spark refuses this way when it is disconnected, the invoice has expired, prepare fails, the fee cap is exceeded, or the invoice is RestoredInvoiceUnverified.
Mechanism
In QuickPayRepo.handleDispatchError, classifyDispatchError maps SendRefused to PRE_DISPATCH_REJECTION. That branch calls signalCompletionLocked(success = false) and then emitOutcomeLocked.
For an undispatched op, the ledger record is still SUBMITTING with paymentId == null. isAttributedFailure returns false for such a record, so signalCompletionLocked returns without spend.settle / spend.release.
emitOutcomeLocked then removes the op from opsByKey.
The SUBMITTING ledger record stays, so:
its amount counts toward the daily spend until the day rolls over;
a later pay of the same invoice finds the record through spend.matching and enters RECOVERED / Pending.
Expected
A pre-dispatch rejection of an op QuickPay never dispatched releases its reserve, the same way releaseIfNotDispatched and fallBackBeforeDispatch already do.
Moved to 3.2.0: Spark payments are new in 3.2.0, so this QuickPay bug on Spark ships with that release. RC1 is already cut, so the fix goes into the next 3.2.0 RC.
Activity
ovitrif commentedon Nov 27, 2026
Moved to 3.2.0: Spark payments are new in 3.2.0, so this QuickPay bug on Spark ships with that release. RC1 is already cut, so the fix goes into the next 3.2.0 RC.