droppyjs / droppy

Self-hosted file storage
https://droppyjs.com
BSD 2-Clause "Simplified" License
107 stars 13 forks source link

Fix uploads race #91

Closed vahtos closed 8 months ago

vahtos commented 8 months ago

Closes: #87

This took quite a bit to understand what was happening... and ultimately looks like it was a typo. req.on("close"... was racing with bb.on("finish"..., and it seems that is because req.on("close"... should actually be bb.on("close"....

One note about the current setup of bb.on("finish") and bb.on("close") is that (if I am understanding correctly) it is possible that we would move the temp files into place before the file stream buffer is actually finished/closed. See the answer from mscdex (busboy author).

markhughes commented 8 months ago

Thanks for spending the time to research this one!