feat(send): improve Lightning send failure recovery - #1140
Open
pwltr wants to merge 4 commits into
Open
Conversation
pwltr
force-pushed
the
feat/reset-routing
branch
3 times, most recently
from
August 12, 2026 12:41
6a53759 to
873d26e
Compare
pwltr
force-pushed
the
feat/reset-routing
branch
from
August 12, 2026 12:42
873d26e to
776366e
Compare
pwltr
marked this pull request as ready for review
August 12, 2026 12:42
Greptile SummaryThe PR replaces toast-only Lightning send failures with a recoverable failure screen, localized failure reasons, support-report prefilling, and routing-cache resets for routing-related retries.
Confidence Score: 4/5The PR should not merge until pending QuickPay failures can retry without crashing from cleared payment state. The new Pending branch clears the only QuickPay request state, while the corresponding failure route explicitly returns to a destination that requires that state to be non-null. Files Needing Attention: app/src/main/java/to/bitkit/ui/screens/wallets/send/SendQuickPayScreen.kt, app/src/main/java/to/bitkit/ui/sheets/SendSheet.kt
|
| Filename | Overview |
|---|---|
| app/src/main/java/to/bitkit/ui/screens/wallets/send/SendQuickPayScreen.kt | Moves QuickPay cleanup to terminal results, but clearing state on Pending breaks the newly added pending-failure retry route. |
| app/src/main/java/to/bitkit/ui/sheets/SendSheet.kt | Adds typed failure navigation, support reporting, and routing-aware retry behavior; its QuickPay retry destination still requires state that the Pending path clears. |
| app/src/main/java/to/bitkit/repositories/LightningRepo.kt | Adds graph/scorer cache reset and bounded routing-data refresh orchestration without an independently established defect. |
| app/src/main/java/to/bitkit/viewmodels/AppViewModel.kt | Routes active Lightning failures into the send sheet and preserves typed failure details and payment requests. |
| app/src/main/java/to/bitkit/viewmodels/WalletViewModel.kt | Serializes routing-reset retries with a mutex and exposes retry progress to the UI. |
| app/src/main/java/to/bitkit/ext/PaymentFailureReasonExt.kt | Maps LDK failure reasons to localized user copy and sanitized compact support metadata. |
Sequence Diagram
sequenceDiagram
participant User
participant QuickPay as QuickPay Screen
participant AppVM as AppViewModel
participant Pending as Pending Screen
participant Error as Failure Screen
QuickPay->>AppVM: resetQuickPay()
QuickPay->>Pending: "navigate with retryRoute=QuickPay"
Pending-->>Error: payment failure
User->>Error: Try Again
Error->>QuickPay: clear stack and navigate
QuickPay->>AppVM: read quickPayData
AppVM-->>QuickPay: null
QuickPay--xQuickPay: requireNotNull crashes
Reviews (1): Last reviewed commit: "feat(send): improve Lightning send failu..." | 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.
Description
Ports the iOS Lightning send-failure retry/support behavior to Android.
Optional(...),NodeError, orDuplicatePayment.routeNotFoundandretriesExhausted.SendPendingScreenand fail later.WalletViewModelso overlapping retry flows cannot surface stale timeout errors.Closes #829
Preview
Normal payment:
Screen.Recording.2026-08-11.at.17.59.27.mov
QuickPay:
Screen.Recording.2026-08-12.at.14.55.13.mov
QA Notes
Tested on mainnet emulator:
ROUTE_NOT_FOUNDsurfaces user-facing payment failure copy.RETRIES_EXHAUSTEDfailures surface the localized retries-exhausted copy instead of generic failure copy.Automated checks:
compileDevDebugKotlinPaymentFailureReasonExtTest.ktAppViewModelSendFlowTest.ktdetekt