Re: [whatwg/fetch] 5.6 garbage collection makes GC observable via service worker & resource timing (#810)

While it's not implemented I think auto cancellation is useful for users. It is very easy to forget to read all data or abort the pending fetch.

> fetch(url);  // This will leak!

Please note that, even if you get a response, you need to read all the response body.

> let resp = await fetch(url);
> const headers = resp.headers;
> resp = null; // This will leak!

I've seen this pattern many times in WPTs.

Also, the backpressure mechanism makes the situation worse, as it will keep the pending fetch indefinitely.


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/issues/810#issuecomment-424559270

Received on Wednesday, 26 September 2018 02:01:15 UTC