Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upOnly emit 'done' when the store behind immediate store finished to write the chunks #1517
Labels
Comments
This comment has been minimized.
This comment has been minimized.
|
Any update with this issue? |
This comment has been minimized.
This comment has been minimized.
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
This comment has been minimized.
This comment has been minimized.
|
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
With the FS chunk store, the torrent might emit
donewhile 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
doneevent when all the callback are called: https://github.com/webtorrent/webtorrent/blob/master/lib/torrent.js#L1526