Re: [w3c/ServiceWorker] Handing fetch termination (#1178)

@annevk re:

> "Fetch is terminated." is not really a signal we expose to the outside (other than the response having a termination reason or the stream erroring).

I agree, but this feels like a special case since fetch called me, I didn't call fetch.

In the fetch spec I've tried to keep termination handling as close to the leaf end as I can. [HTTP fetch](https://fetch.spec.whatwg.org/#concept-http-fetch) doesn't have a "If terminates" break clause around the call to service workers, so it feels "handle fetch" should be handling the termination.

Alternatively, I could add a break clause the call to "handle fetch" in "main fetch". Then, in "handle fetch" I can somehow "handle response" for the outer fetch, and see if its abort flag is set. But this will be really messy, as the fetch spec is waiting for a response from the service worker spec, but the service worker spec is also waiting for a response from the fetch spec. I'd also end up looping the service worker response back into the service worker spec, and I'd need to ignore that somehow.

I've updated the PR a little, but it seems to express the behaviour pretty clearly. It's a bit hand-wavey around getting an instance of the fetch, but I think that's part of https://github.com/whatwg/fetch/issues/536#issuecomment-330482027.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/ServiceWorker/pull/1178#issuecomment-332824728

Received on Thursday, 28 September 2017 12:45:19 UTC