Skip to content

Improve stream handling #2449

@PE39806

Description

@PE39806

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is neededjavascriptPull requests that update Javascript codemodel artefact managementtech debtA feature/requirement implemented in a sub-optimal way & must be re-written

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions