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

Webtorrent emitting completed event to trackers multiple times #2441

Open
funniray opened this issue Jan 17, 2023 · 1 comment
Open

Webtorrent emitting completed event to trackers multiple times #2441

funniray opened this issue Jan 17, 2023 · 1 comment
Labels

Comments

@funniray
Copy link
Contributor

What version of this package are you using?
master@14fe83f

What operating system, Node.js, and npm version?
Windows 11, nodejs v16.13.1, npm 8.1.2

What happened?
Each time a piece is stored when all selections are fulfilled (eg: removing a selection) causes WebTorrent to announce completed to the trackers. This causes completed to be announced multiple times. I believe this is caused by _checkDone not checking for currently outstanding piece reservations outside of the current selections.

What did you expect to happen?
For completed to only be announced once all reservations are downloaded/cancelled.

Are you willing to submit a pull request to fix this bug?
yes

Steps to reproduce

  • Add a magnet URI with &so= appended to the end of the URI (Removes default selection)
  • Add a file to a <video> using .streamTo
  • Play and then pause the video to add and remove selections
  • Observe the tracker to see multiple completed events being announced
@gauravsaini
Copy link

#2512

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants