Skip to content

lib: fix unhandled errors in webstream adapters

Rodrigo Muino Tomonari requested to merge github/fork/indutny/fix/gh-54205 into main

WebStream's Readable controller does not tolerate .close() being called after an error. However, when wrapping a Node's Readable stream it is possible that the sequence of events leads to finished()'s callback being invoked after such error.

In order to handle this, in this change we call the finished() handler earlier when controller is canceled, and always handle this as an error case.

Fix: https://github.com/nodejs/node/issues/54205

Merge request reports

Loading