Skip to content

Conversation

@ben-kaufman
Copy link
Contributor

Fixes #736

This PR improves Lightning payment failure error messages by parsing the PaymentFailureReason from LDK-node and displaying user-friendly, actionable messages instead of a generic "Your instant payment failed" toast.

Description

Previously, all Lightning payment failures showed the same generic error message regardless of the actual cause. This made it impossible for users to understand why their payment failed or what action to take.

The PR maps PaymentFailureReason enum values to specific user-friendly messages:

Failure Reason User Message
RECIPIENT_REJECTED "The recipient rejected this payment. Try a different amount."
RETRIES_EXHAUSTED "Could not find a route with sufficient liquidity. Try a smaller amount or wait and try again."
ROUTE_NOT_FOUND "Could not find a payment path to the recipient."
PAYMENT_EXPIRED "Payment timed out. Please try again."
Other/Unknown "Your instant payment failed. Please try again." (original generic message)

Preview

QA Notes

1. Test payment failure messages

  1. Open Bitkit with an active Lightning channel
  2. Attempt to send a payment to an offline recipient or with an amount that will fail routing
  3. Verify the toast message is contextual (not generic)
  4. The message should provide actionable guidance

2. Test QuickPay flow

  1. Use QuickPay to scan a Lightning invoice
  2. If payment fails, verify the error message shown matches the failure type

3. Test background notifications

  1. With background notifications enabled, trigger a payment failure
  2. Verify the push notification body shows the user-friendly message

4. Regression

  • Successful payments should still show success toast
  • Payment received notifications should be unaffected

@ben-kaufman ben-kaufman requested a review from jvsena42 January 27, 2026 18:12
@claude

This comment has been minimized.

jvsena42

This comment was marked as resolved.

Copy link
Member

@jvsena42 jvsena42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

insuficient-inbound-recipient.webm

@jvsena42 jvsena42 enabled auto-merge January 30, 2026 12:46
@jvsena42 jvsena42 requested a review from ovitrif January 30, 2026 12:52
@claude
Copy link

claude bot commented Jan 30, 2026

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Generic error message for Lightning payment failures hides actual cause

3 participants