Skip to content

QuickPay keeps the daily spend reserved when Spark refuses before dispatch #2161

Done

Description

@jvsena42

Problem

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.

Notes

Activity

  1. self-assigned this
    on Nov 27, 2026
  2. added this to the 3.2.0 milestone on Nov 27, 2026
  3. ovitrif commented on Nov 27, 2026

    @ovitrif
    Collaborator

    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.

  4. self-assigned this
    on Nov 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions