LedgerHQ/ledger-live-common

Support for terQUEUED as a potentially successful case while in swap flow

juan-cortes opened this issue · 1 comments

The current implementation of the js bridge for XRP will consider any application result other than tesSUCCESS to be a failure. We do offer the user a disclaimer message in case the broadcast succeeded to prevent them from sending the transaction again.

Your transaction may have failed. Please wait a moment then check the transaction history before trying again.

This is all good and fine for normal transactions, since the user can really wait, and we can rebuild the transaction from the blockchain once/if it ends up being there. However, for the swap flow, we can't do that and failing to consider terQUEUED as a success results in the user not having access to the swapId, the swap not reaching the history, and potentially the user sending the swap twice.

https://github.com/LedgerHQ/ledger-live-common/blob/master/src/families/ripple/bridge/js.js#L188-L190

We should potentially return the operation, if the resultCode is terQUEUED but I'm not sure if this is the right solution in this case.

Will be addressed in #979