Description
We started testing node v16 and started to see a test failing. It did work in earlier node versions (14). without any problems. Now it's a blocker for us and I don't know how to fix it.
This is the related PR/test that did implement it: node-fetch/node-fetch#671
it has something to do with HighWaterMark i think.
essentially the problem is that we are cloning/tee:ing the stream into two destinations (PassThrough) when calling response.clone()
Then the developers only use one of the streams and the other is forgotten or not used at all.
Thinking of refactoring this hole clone function to be smarter/more spec compliant with how Response.prototype.clone()
works in browser by not using HighWaterMark
at all if possible... Maybe even use WeakRef, finalizer and perhaps operate on async iterator instead to handle both whatwg streams and node streams in the feature.