sphinx-kotlin
sphinx-kotlin copied to clipboard
direct pay failed payment showing as paid to sender
So as the send when the payment failed and we saw this error on the node KEYSEND ERROR: FAILURE_REASON_TIMEOUT
I'm thinking on the client side it's assuming it went through even though it could have failed
Sender view
This is what it looks like to everyone else
Receiver view
@kevkevinpal @mouawiahammo I think this ticket should be moved to sphinx-relay repo. The client will think the pmt went through if relay return success to the sendMessage request. It has no other way to know about the pmt status.
Same happens with normal text messages. Relay is not waiting for the pmt to go through and it's returning to the app before that.
For the case of a tribe pmt it is even worse, because the relay of the sender will send the pmt to the tribe admin, and then the tribe admin will forward it to the pmt destination. It could fail from sender to admin, or from admin to destination and client will never know.
@kevkevinpal @tomastiminskas yeah totally i think you could leave this ticket and open another in sphinx-relay
and i 'll write what i found here to keep track of the information :
- where tribe payments/ direct pay come from ?
tribe payments/ direct pay goes through the message builder because it's the only way you can get reference of other tribe members by forwarding the payment to tribe admin and then send it from there
- why tribe payment/ direct pay failed showing as paid to sender
because the tribe payments/ direct pay goes through message builder not payment builder, it's not waiting for the payment response status if relay return success on
sendMessage
it updates the client side regardless
- possible solution ?
update relay to return Success or Failure depending on the state of the payment request or if the message went through or not
"reversal" payment (where a direct_payment
or a boost
fails to be forwarded by tribe admin) already sends a socket message here: https://github.com/stakwork/sphinx-relay/blob/master/src/utils/reversal.ts#L37
The type
is either direct_payment
or boost
, and the response is the Message object with the errorMessage
on it
@tomastiminskas
@Evanfeenstra along with the error_message, will the status of the message be "failed"?