sphinx-kotlin icon indicating copy to clipboard operation
sphinx-kotlin copied to clipboard

direct pay failed payment showing as paid to sender

Open kevkevinpal opened this issue 2 years ago • 4 comments

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 Screen Shot 2022-07-01 at 9 04 24 AM Screen Shot 2022-07-01 at 9 04 33 AM

This is what it looks like to everyone else Receiver view Screen Shot 2022-07-01 at 9 04 33 AM

kevkevinpal avatar Jul 01 '22 15:07 kevkevinpal

@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.

tomastiminskas avatar Dec 06 '22 13:12 tomastiminskas

@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

MathRoda avatar Dec 15 '22 11:12 MathRoda

"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 avatar Sep 19 '23 21:09 Evanfeenstra

@Evanfeenstra along with the error_message, will the status of the message be "failed"?

tomastiminskas avatar Sep 19 '23 21:09 tomastiminskas