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

Only emit 'done' when the store behind immediate store finished to write the chunks #1517

Open
Chocobozzz opened this issue Sep 26, 2018 · 3 comments

Comments

@Chocobozzz
Copy link
Contributor

@Chocobozzz Chocobozzz commented Sep 26, 2018

With the FS chunk store, the torrent might emit done while the store did not finished to write the chunks in the file. So if we then manipulate the file we may have inconsistencies errors.

We could add a callback here: https://github.com/webtorrent/webtorrent/blob/master/lib/torrent.js#L1492, store them in an array (one per file) and only emit the done event when all the callback are called: https://github.com/webtorrent/webtorrent/blob/master/lib/torrent.js#L1526

@whitesunset

This comment has been minimized.

Copy link

@whitesunset whitesunset commented Dec 22, 2018

Any update with this issue?

@stale

This comment has been minimized.

Copy link

@stale stale bot commented Mar 22, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale label Mar 22, 2019
@stale stale bot closed this Mar 29, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 27, 2019
@webtorrent webtorrent unlocked this conversation Sep 6, 2019
@feross feross reopened this Sep 6, 2019
@stale stale bot removed the stale label Sep 6, 2019
@feross

This comment has been minimized.

Copy link
Member

@feross feross commented Sep 6, 2019

This sounds like a bug. PR welcome to fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.