-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Description
The code here is incorrect since it is listening to the source stream "end" event which may trigger much sooner than the target stream has actually completed the writing to disk:
Line 352 in c2dbc95
| res.on ('end', function (err) { |
Instead you must listen to the "finish" event on the downloadStream, to make sure the file is completely stored and closed in disk. You may have not noticed this problem since as long as the process is still alive the file will eventually complete, but if the process closes before, you end with a truncated file. Use case: "electron-simple-updater" will close after downloading the latest version of an app and most likely end with a truncated file that will end with the end-user having a broken electron app.
Metadata
Metadata
Assignees
Labels
No labels