remix-run / remix-website

322 stars 72 forks source link

Fix memory leaks with undici introduction #249

Closed brookslybrand closed 4 months ago

brookslybrand commented 4 months ago

Undici does not garbage collect unconsumed response bodies

The Fetch Standard allows users to skip consuming the response body by relying on garbage collection to release connection resources. Undici does not do the same. Therefore, it is important to always either consume or cancel the response body.

This ended up causing a memory leak because I was relying on this without realizing when determining whether or not a Remix Resource's creator has a GitHub Sponsors page setup.