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
add
and remove
are not async safe
#2685
Comments
those are async functions, you simply need to run await client.add() and await client.remove() |
consider the case where
|
fair |
while we're at it, these functions should probably not have a cb parameter and be async at the same time. |
add
and remove
are not async safe under heavy loadadd
and remove
are not async safe
they should be, but not as a part of this issue this was planned for ages: https://github.com/orgs/webtorrent/projects/1#card-60702582 they became async because other issues were being blocked by it, and using .then would be useless if it was later re-written to await anyways, and dropping callback based calls for webtorrent, means doing it inside close to 20 packages, which requries a lot of testing and rewriting |
Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward? |
What version of this package are you using?
^2.1.27
What operating system, Node.js, and npm version?
ubuntu 23.4
v19.0.0
8.19.2
What happened?
It's possible to get
add
andremove
to throw if calling them in parallel, even with different hash ids.What did you expect to happen?
remove
should not throw if it can't find the torrent.add
should not throw if the torrent is already added.Are you willing to submit a pull request to fix this bug?
yes
The text was updated successfully, but these errors were encountered: