All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Busboy file stream errors are now caught and forwarded to the corresponding Pechkin file streams. Pechkin file stream is destroyed and the same error is thrown, with "Error in busboy file stream" prepended.
- Cleanup process on request errors. Previously, only
request.unpipe()
was called on error. Now, an approach inspired by Multer source code was taken:-
Unpipe the request stream from the parser
-
Remove all event listeners from the parser
-
Resume the request stream.
-
Why
req.resume()
and notreq.pause()
?- Pausing causes the internal Node.js TCP stack buffers to overflow, backpressure is propagated through the network, TCP congestion control kicks in, and may probably slow down the network (?)
- Resuming doesn't consume any additional memory, and any CPU usage is negligible (networks are much slower than CPUs)
-
Why not
req.destroy()
?- I'm actually not sure. I think it's better to leave it up to the user to decide when and how to close the request. A simple
res.end()
should be enough.
- I'm actually not sure. I think it's better to leave it up to the user to decide when and how to close the request. A simple
-
-
Update documentation for NPM.
For migration guide, check comments on file system and S3 upload examples.
bytesWritten
,bytesRead
,truncated
getters toByteLengthTruncateStream
class.
maxFileByteLength
error handling:maxFileByteLength
now works as expected and throws an error when the file size exceeds the limit.ByteLengthTruncateStream
now directly throws themaxFileByteLength
Error
. Previously, only thebyteLength
property (the event handlers inside the promise creation) were responsible for throwing the length limit error; which meants that if you don't use and properly error-handle thebyteLength
promise, in case file byte length limit was reached, it'd trigger an unhandled promise rejection.