particle4dev / dicoapp-e

SPV lightweight GUI wallet with barterDEX swap capabilities
MIT License
1 stars 11 forks source link

Swap status freezes after changing to wallet screen mid swap #64

Closed siulynot closed 6 years ago

siulynot commented 6 years ago

Currently: When i change to wallet page while there is a swap happening and come back, the swap status gets frozen where it was when i changed pages. The swap does goes through and the balances change but the status gets stuck

Expected: The swap status should keep updating and let the user know it finished even if the user moves to another page while a swap is happening

STEPS TO REPRODUCE: Execute a swap, let it go through, then change to wallet page mid swap and go back to swap page. It will be stuck where it left and wont update anymore

REFERENCE: http://i.imgur.com/NwgVlHf.png

Possible fixes:

Related issues

#

Related Merge Requests

#

/label ~bug

siulynot commented 6 years ago

It did eventually change the status and updated to finished. This issue can be closed.

particle4dev commented 6 years ago

Currently, we call recentSwaps API every 10 seconds to update swap status. This is not a "smart" way but it works.

https://github.com/particle4dev/dicoapp-e/blob/master/app/containers/BuyPage/components/AmountSection.js#L246

I just noticed that BarterDEX also has WebSocket API. If we can use it, the swap status will be updated in real-time and the bug like above will never gonna happen :). Cheer!

https://docs.komodoplatform.com/barterDEX/barterDEX-API.html#getendpoint