fix(send): preserve pending send failure details - #663
Open
pwltr wants to merge 1 commit into
Open
Conversation
Greptile SummaryThis PR preserves Lightning payment failure details and invoice context when a timed-out payment later resolves as failed.
Confidence Score: 5/5The PR appears safe to merge, with pending failures now consistently retaining their failure and support-report context. The changed flow preserves optional failure reasons without introducing an unsafe nil path, retains existing routing-cache retry semantics, and associates each pending route with the invoice used for that payment.
|
| Filename | Overview |
|---|---|
| Bitkit/ViewModels/AppViewModel.swift | Preserves the optional LDK failure reason when resolving a registered pending payment. |
| Bitkit/Views/Wallets/Send/SendPendingScreen.swift | Converts the preserved reason into the standard failure context and forwards retry and invoice context. |
| Bitkit/Views/Wallets/Send/SendSheet.swift | Extends pending routes with optional payment-request context and supplies existing routing-cache retry state. |
| Bitkit/Views/Wallets/Send/SendConfirmationView.swift | Captures the invoice BOLT11 when a standard Lightning send transitions to pending. |
| Bitkit/Views/Wallets/Send/LnurlPayConfirm.swift | Captures the generated LNURL-pay BOLT11 when the payment transitions to pending. |
| Bitkit/Views/Wallets/Send/SendQuickpay.swift | Captures the quick-pay BOLT11 when the payment transitions to pending. |
Sequence Diagram
sequenceDiagram
participant Send as Send screen
participant App as AppViewModel
participant Pending as SendPendingScreen
participant Failure as SendFailure
Send->>App: Register timed-out payment hash
Send->>Pending: Navigate with hash, retry route, BOLT11
App-->>App: Receive paymentFailed(hash, reason)
App->>Pending: Publish resolution with failure reason
Pending->>Failure: Navigate with AppError(reason), retry state, BOLT11
Failure-->>Failure: Localize reason and determine cache-reset eligibility
Failure-->>Failure: Prefill support report with BOLT11
Reviews (1): Last reviewed commit: "fix(send): preserve pending send failure..." | Re-trigger Greptile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PaymentFailureReasonwhen a Lightning payment times out into Pending and later fails.routeNotFoundandretriesExhausted.Follow-up to #652, no changelog entry needed.
Simulator.Screen.Recording.-.iPhone.17.-.2026-08-12.at.14.28.39.mov