Skip to content

bug: paid spark send shows as failed after a storage error #2025

Todo

Description

@ovitrif

A Spark send that completed can show as failed when a cache write fails on the settlement path.

In SparkRepo.kt, the cache writes in payInvoice around the uncertain-send bookkeeping (removeSparkUncertainSend and its neighbours) and in settleUncertainSend can still throw. If removeSparkUncertainSend fails after Spark returned COMPLETED, payInvoice returns the IOException for a paid invoice and LightningRepo restores the previous rail, so the user sees a failure.

There is no double pay: the uncertain entry stays, a retry reads PENDING, and the next sync settles it. Until then the send looks failed.

Expected: these writes are best-effort like the own-failure marker writes in #2015, so a storage error never turns a completed send into a failure.

Found by @jvsena42 in #2015 (comment). It predates that PR.

Activity

  1. added this to the 3.2.0 milestone on Nov 25, 2026
  2. added theissue type on Nov 25, 2026
  3. self-assigned this
    on Nov 25, 2026
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

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions