Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fail/cancel message is sent incorrectly for a swap that isn't cancelled #956

Open
lukechilds opened this issue Aug 19, 2018 · 2 comments
Open

Comments

@lukechilds
Copy link
Contributor

lukechilds commented Aug 19, 2018

We came across a bug in mm where it will incorrectly send a failed message telling us a trade has been cancelled when it hasn't. This seems to be what happened:

  • Issue a cancel for a pending trade
  • Cancel command appears to get blocked internally in mm
  • Trade matches
  • We get update events on the progress of the trade
  • Mid trade we get an error event with code -9997 which means a trade has been successfully cancelled
  • Trade was already matched so couldn't actually be cancelled
  • Continue to receive trade progress update events
  • Trade completes successfully

Are you able to looks into this? We are handling it by continuing to listen for messages with the UUID of all trades, even after a cancel event and still updating the UI. However this is extremely confusing for users, the trade will show as pending => matched => swapping => cancelled => swapping => complete.

Swap debug data here:

https://gist.github.com/sindresorhus/b2332c940459aa6c590678854fe1e869

Check ._debug.messages array for a list of all socket messages we recieved in order. Notice the failed event at line 341.

@lukechilds
Copy link
Contributor Author

Just got the same issue again and I definitely didn't issue a cancel request. So it seems mm is sending cancel events on its own.

https://gist.github.com/lukechilds/37a8032aa3af04b2bd715d3c1db923f3

@lukechilds
Copy link
Contributor Author

Appears the issue sometimes happens with both of these errors: -9998, -9997.

lukechilds added a commit to atomiclabs/hyperdex that referenced this issue Aug 22, 2018
sindresorhus added a commit to atomiclabs/hyperdex that referenced this issue Aug 27, 2018
sindresorhus pushed a commit to atomiclabs/hyperdex that referenced this issue Aug 27, 2018
sindresorhus pushed a commit to atomiclabs/hyperdex that referenced this issue Aug 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant