-
Notifications
You must be signed in to change notification settings - Fork 18
Description
Problem
Some of the way that we handle streams is inconsistent and not best practice.
Proposed Solution
We should be making sure to wrap streams in try catch
blocks where the catch
calls stream.destroy()
(or equivalent) to prevent having orphaned events. Where possible, we should try to use Node streams rather than WHATWG streams for consistency, although this is not a hard and fast rule.
A chunk of this work was addressed in #2436 but that PR ballooned in scope, and was fundamentally flawed due to trying to stream extraction of .zip
files. It is suggested to look into this PR to find possible solutions to some of the above requirements.
Alternatives
We could prefer WHATWG streams but I've found that these a little bit more cumbersome. I'm happy to have a healthy discussion around this if others disagree, and I think there will always be certain cases where WHATWG streams may be better suited than Node streams (and vice versa).
What is the priority of your issue?
Low