Skip to content

bug: late spark failure event ends a retry's hold #1848

Done

Description

@ovitrif

Found in @pwltr's review of #1697 at 5953744 (review).

Behaviour

A retry of a failed Spark send shares the invoice's payment hash. When the retry's send call fails without an outcome, SparkRepo holds the invoice until a sync after the failure, and the invoice's expiry, settle it. onPayment (SparkRepo.kt) clears that hold by payment hash for any payment event, a failure event included. A failure event that belongs to the earlier attempt and arrives after the retry went uncertain would end the retry's hold. The listing then shows only the earlier FAILED row, so either rail could pay the invoice again while Spark may still finish the retry.

Open

  • Whether the Breez SDK can deliver an earlier attempt's PaymentFailed after a later send call on the same hash has returned. Duplicate settlement has not been demonstrated.
  • If it can, clear the hold on a failure event only when the event belongs to the uncertain attempt (for example by payment id or timestamp), and otherwise leave it to the expiry rule in trySettleUncertainSend.

Activity

  1. added this to the 3.2.0 milestone on Nov 11, 2026
  2. changed the title [-]fix: late spark failure event ends a retry's hold[/-] [+]bug: late spark failure event ends a retry's hold[/+] on Nov 11, 2026
  3. self-assigned this
    on Nov 17, 2026
  4. ovitrif commented on Nov 20, 2026

    @ovitrif
    CollaboratorAuthor

    Fixed by the redesign in #1957 (904e629). A failure event for a send in doubt no longer clears its hold by hash. One that Spark dates more than 10 s before the send's start is an earlier attempt's and changes nothing, so the invoice stays held and its row stays pending. Only the send's own failure, its success or its invoice's expiry ends it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions