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

Sign and send in extension is broken #244

Closed
bonomat opened this issue Aug 15, 2021 · 3 comments · Fixed by #247
Closed

Sign and send in extension is broken #244

bonomat opened this issue Aug 15, 2021 · 3 comments · Fixed by #247
Labels
bug Something isn't working

Comments

@bonomat
Copy link
Member

bonomat commented Aug 15, 2021

We have the following flow if a user wants to trade against bobtimus:

  1. go to Trade tab.
  2. fill in desired BTC or USDT amount
  3. manually open extension page
  4. click Sign and Send
  5. the extension page should redirect to home where balances, etc are shown
  6. the web app should redirect /swapped/tx/123e41....

At the moment step 5 is broken, i.e. the user stays on the Sign and Send page. Signing works and the web app gets redirected.

@bonomat bonomat added the bug Something isn't working label Aug 15, 2021
@bonomat
Copy link
Member Author

bonomat commented Aug 15, 2021

cc @thomaseizinger: this could have something todo with your refactoring.

@thomaseizinger
Copy link
Contributor

Interesting. This isn't covered by the tests then?

On that front: We don't have proper routing in the extension yet. Would be a good thing to add. The current state keeping and decision making what is being rendered is error prone as we can see.

@bonomat
Copy link
Member Author

bonomat commented Aug 15, 2021

Interesting. This isn't covered by the tests then?

The test only covers that the signing and sending (i.e. the swap) was successful. It stops afterwards :)

thomaseizinger added a commit to thomaseizinger/droplet that referenced this issue Aug 16, 2021
Floating promises make awaiting a function useless because the promise
is just executed in the background and the function returns immediately.
In our case, this led to the onSuccess() handler in the ConfirmSwap component
being called too early and hence the page refreshed at a point where the
old state (i.e. the swap to sign) was still present.

Fixes comit-network#244.
thomaseizinger added a commit to thomaseizinger/droplet that referenced this issue Aug 16, 2021
Floating promises make awaiting a function useless because the promise
is just executed in the background and the function returns immediately.
In our case, this led to the onSuccess() handler in the ConfirmSwap component
being called too early and hence the page refreshed at a point where the
old state (i.e. the swap to sign) was still present.

Fixes comit-network#244.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants