Open darioAnongba opened 1 month ago
Good catch. pay
calls sendpay
multiple times, so the failures of each sendpay
is not 1:1. And we do update the database to set the status, but we don't set it in the local one.
Hi Rusty,
Any short term recommendations to fix this? The main problem being that we cannot know for sure that the payment has failed since we do not receive any event for such. Currently we fail the payment on "timeout" (and can reconcile the status by fetching from the node).
The "sendpay_failure" notification itself is sufficient, you can ignore the status for now?
Okay, so just to clarify, getting a "sendpay_failure" is sufficient regardless of receiving multiple and regardless of status "pending" ? Meaning we can get the first event, assume the payment has failed and discard subsequent events?
Issue and Steps to Reproduce
pay
functionrune
I'm not entirely sure if this is a bug or a normal behaviour from the node but it seems odd. When sending a payment from our node:, we get the following logs from the node:
The error itself is not the issue. The problem is that we receive multiple
sendpay_failure
notifications on the websocket listener with the statuspending
. On our implementation, we expect the status to befailed
.Expected
Receive a notification with status
failed
for the payment, given that it was initiated with thepay
RPC command, that returns on success or failure.It would also be acceptable to receive multiple notifications for each failed attempt but we need an actual final notification for the payment failure.
Current behaviour
Receive multiple
sendpay_failure
notifications withpending
status and no notification withfailed
status. The consequence is that we receive 4sendpay_failure
notifications for the samepayment_hash
. None of them stating for sure that the payment failed.getinfo
output: