Re: [w3c/ServiceWorker] should clients.claim() control reserved Clients? (#1090)

> I think that is a different case. The new SW will not move to active if there is a controlled Client.

`skipWaiting()` makes it ignore that condition.

> It can use skipWaiting() to automatically take control of already controlled Clients. As you point out, those algorithms should probably apply to reserved Clients.
> 
> As I understand it clients.claim() is only about taking control of Clients that are not already controlled.

`skipWaiting()` gives a chance for the installed service worker to promote to active even if there are controlled clients. 'clients.claim()` basically replaces the controller of the clients that are under the scope of the service worker's registration if those clients' controller wasn't the same one. So I thought claim() should apply to reserved clients.

> Its unclear to me what the intent is if the Client is controlled by a different service worker registration due to overlapping scopes. @jakearchibald, what did you intend there?

`clients.claim()` targets those clients that have a matching registration and that registrations is the same as the claiming service worker's registration. So the registration with the most specific matching scope is taken when a client is under multiple overlapping scopes.  [`clients.claim()`](https://w3c.github.io/ServiceWorker/#clients-claim) step 3.1.3 and 3.1.4 are that part of the algorithm.

-- 
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/1090#issuecomment-288588305

Received on Thursday, 23 March 2017 01:16:32 UTC