Re: [w3c/ServiceWorker] reserved Client objects and redirected navigations (#1031)

Thanks for spotting this!

> I personally lean towards creating a new reserved Client on every redirect. This would also ensure the Client.url matches the actual final URL loaded in the window. It also seems conceptually consistent with an algorithm that uses manual redirection and re-enters the service worker each time. It also simplifies edge cases for the service worker code. It doesn't have to worry about possibly having a reserved Client postMessage()'d by two different service workers or twice by the same service worker by accident.

Agreed to all those points. _Redirect mode_ `"manual"` and the fact that every redirect going through registration match again seem like good reasons we have new reserved clients for them.

> I guess there is an open question here about how close we need to keep worker and window Client behavior to each other. Closer seems better, though.

Basically, I think we can think of it as we defer the behavior to what the request expect to fetch. Here, the worker script fetch `"follows"` redirects, so a single reserved client makes sense to me. Note that, though, in https://github.com/w3c/ServiceWorker/issues/1034#issuecomment-267883726, I suggested we initialize the reserved client's url to the request url in the worker case, too.

-- 
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/issues/1031#issuecomment-267893705

Received on Monday, 19 December 2016 06:48:42 UTC