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

Concurrency: multiple swaps in progress in several browser tabs can make swaps disappear #498

Closed
kilrau opened this issue Mar 10, 2024 · 2 comments · Fixed by #544
Closed
Assignees
Labels
bug Something isn't working P1

Comments

@kilrau
Copy link
Member

kilrau commented Mar 10, 2024

To reproduce open
Tab A
Tab B

Create a swap on tab A first.

Then create a swap on tab B.

Then pay tab B.
Then pay tab A.

Tab A will suddenly after a little bit refresh automatically to:
Swap: 8BECEncszXXX
Swap not found!

index-762f6f80.js:244 Uncaught TypeError: Cannot read properties of null (reading 'asset')
    at Object.fn (index-762f6f80.js:244:12863)
    at ST (index-762f6f80.js:1:4303)
    at Rh (index-762f6f80.js:1:4244)
    at sC (index-762f6f80.js:1:5026)
    at MT (index-762f6f80.js:1:5487)
    at index-762f6f80.js:1:5326
    at Ig (index-762f6f80.js:1:5186)
    at kT (index-762f6f80.js:1:5319)
    at Ig (index-762f6f80.js:1:5197)
    at P0 (index-762f6f80.js:1:1865)

Looks like everything uses the same storage key.

@kilrau kilrau added bug Something isn't working P1 labels Mar 10, 2024
@dni
Copy link
Contributor

dni commented Mar 13, 2024

cannot reproduce

@LordDotSH
Copy link

Was it exact with two different tabs in same browser, you started the order on both, but pay on your last created order first, then the first order, with them still both open/not refreshed manually?

If it doesn't work I'm cool to try reproduce it again and then do a screenshare with you.

dni added a commit that referenced this issue Mar 30, 2024
closes #498
refactor how to add/update/get a swap via globalContext
dni added a commit that referenced this issue Mar 30, 2024
closes #498
refactor how to add/update/get a swap via globalContext
dni added a commit that referenced this issue Apr 2, 2024
closes #498
refactor how to add/update/get a swap via globalContext
dni added a commit that referenced this issue Apr 2, 2024
closes #498
refactor how to add/update/get a swap via globalContext

prettier
dni added a commit that referenced this issue Apr 2, 2024
closes #498
refactor how to add/update/get a swap via globalContext

prettier
michael1011 added a commit that referenced this issue Apr 3, 2024
* fix: multiple tabs localstorage issue

closes #498
refactor how to add/update/get a swap via globalContext

prettier

* refactor: store swaps in IndexedDB (#545)

* fix: refund button reactivity

---------

Co-authored-by: michael1011 <me@michael1011.at>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P1
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants