Describe the bug
When attempting to pay an invoice with an amount that exceeds the sender's available balance, Polar incorrectly displays a "Successfully paid the Invoice" message and shows "Sent NaN sats from bob" instead of displaying a proper error notification.
To Reproduce
Steps to reproduce the behavior:
Open Polar application with a Lightning Network node (bob) that has a zero or insufficient balance
- Navigate to the node details for bob (shows 0sats Confirmed Balance, 0sats Unconfirmed Balance)
- Attempt to pay an invoice from another node (e.g., alice or carol) that requests more than the available balance
- Observe that the transaction appears to be processed
- See error: "Successfully paid the Invoice" message appears with "Sent NaN sats from bob"
Expected behavior
When a payment request exceeds the sender's available balance, Polar should display a clear error message indicating insufficient funds. The transaction should not be marked as successful, and the "Sent" amount should display the actual attempted amount or an error indicator, not "NaN" (Not a Number).
Screenshots
Attached screenshot shows bob with 0sats balance, attempting payment with "Successfully paid the Invoice" and "Sent NaN sats from bob" messages in the backend1 log
Desktop (please complete the following information):
- OS: Mac OS Tahoe 26.5.2 (25F84)
- Polar Version: v4.0.0
- Docker Version: v29.6.1
- Docker Compose Version: v5.3.0
Additional context
- The "Sent NaN sats" indicates a numeric parsing error where the payment amount is likely undefined or null, yet the system still treats it as a successful payment
- This could lead to confusion for users who might believe a payment was sent when it actually failed due to insufficient balance
- The issue occurs when attempting to send sats from a node with zero balance (Confirmed Balance: 0sats, Unconfirmed Balance: 0sats)
- The backend1 log in the screenshot shows the erroneous success message despite the balance being insufficient
Describe the bug
When attempting to pay an invoice with an amount that exceeds the sender's available balance, Polar incorrectly displays a "Successfully paid the Invoice" message and shows "Sent NaN sats from bob" instead of displaying a proper error notification.
To Reproduce
Steps to reproduce the behavior:
Open Polar application with a Lightning Network node (bob) that has a zero or insufficient balance
Expected behavior
When a payment request exceeds the sender's available balance, Polar should display a clear error message indicating insufficient funds. The transaction should not be marked as successful, and the "Sent" amount should display the actual attempted amount or an error indicator, not "NaN" (Not a Number).
Screenshots
Attached screenshot shows bob with 0sats balance, attempting payment with "Successfully paid the Invoice" and "Sent NaN sats from bob" messages in the backend1 log
Desktop (please complete the following information):
Additional context