electron/shell
Fedor Indutny 55e7a47d70
fix: always terminate active Node Streams (#43056)
`.destroy()` is an important method in the lifecycle of a Node.js
Readable stream. It is typically called to reclaim the resources
(e.g., close file descriptor). The only situations where calling
it manually isn't necessary are when the following events are
emitted first:

- `end`: natural end of a stream
- `error`: stream terminated due to a failure

Prior to this commit the ended state was incorrectly tracked together
with a pending internal error. It led to situations where the request
could get aborted during a read and then get marked as ended (having
pending error).

With this change we disentangle pending "error" and "destroyed" cases to
always properly terminate an active Node.js Readable stream.

Co-authored-by: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com>
2024-07-27 12:25:43 -05:00
..
app chore: remove more unused #include calls (#43000) 2024-07-25 11:25:45 +02:00
browser fix: always terminate active Node Streams (#43056) 2024-07-27 12:25:43 -05:00
common chore: remove more unused #include calls (#43000) 2024-07-25 11:25:45 +02:00
renderer chore: remove more unused #include calls (#43000) 2024-07-25 11:25:45 +02:00
services/node chore: remove more unused #include calls (#43000) 2024-07-25 11:25:45 +02:00
utility chore: remove unused #includes (#42971) 2024-07-22 11:31:32 +02:00