alanshaw / stream-to-it

🚰 Convert Node.js streams to streaming iterables
Other
18 stars 6 forks source link

fix: memory leak due to Promise.race #7

Closed jacobheun closed 4 years ago

jacobheun commented 4 years ago

Details for why the leak happens are in the issue, https://github.com/alanshaw/stream-to-it/issues/6. This code is heavily influenced by the fix for writeToStream in streaming-iterables but avoids breaking any functionality here.

Clinic.js Reports

I've also listed the IPFS CIDs (linked to the gateway) if you want to peruse in detail.

After bafybeidzy5otcicczh43ifdcg55btdl4q5j75vfolhsygr3oomqjavj6p4 image

Before bafybeig3sw5t326is6e7rknf7ena3ffubekperpsdgf2dty7w74pkvmhai image

Package file changes

$ npm pack --dry-run
npm notice 
npm notice 📦  stream-to-it@0.2.0
npm notice === Tarball Contents === 
npm notice 1.1kB LICENSE     
npm notice 151B  duplex.js   
npm notice 215B  index.js    
npm notice 2.2kB sink.js     
npm notice 494B  source.js   
npm notice 395B  transform.js
npm notice 1.1kB package.json
npm notice 3.4kB README.md

fixes https://github.com/alanshaw/stream-to-it/issues/6

jacobheun commented 4 years ago

Tests are failing on node 14, looking into it.

jacobheun commented 4 years ago

All fixed. @alanshaw ready for your eyes.

jacobheun commented 4 years ago

cc: @achingbrain

alanshaw commented 4 years ago

❤️ thanks so much for fixing this