Re: [w3c/ServiceWorker] consider allowing a non-scope identifier for registrations (#1512)

If the scope is mutable, than getRegistration(clientURL) is non-deterministic as to what will be returned.  Has the scope already changed?  Similarly, getRegistrations() returns all registrations, but you now have to divine which one is the one you want when there is no fixed identifier you can rely on being unchanged.

Again I ask, what specific risk or harm are you concerned about with exposing registration.id?

Trying to think of objections I can come up with these assurances:

* The id is specified by the web developer, so its not any kind of browser generated finger printing vector.
* Exposing an id does not prevent adding a more complex API like your updateScopes().  It would just reference id values to identify the registrations.

As to whether register() is the right place to make a change I feel pretty strongly that it is.  All other multiple properties directly on ServiceWorkerRegistration and ServiceWorker are modified through register() as the mutating function.  It works for both new registrations and modify existing registrations.  (The only exception to this are things like NavigationPreloadManager which are on separate manager objects, but scope is a property and not on a manager object.)

Finally, the partners I have talked to don't seem concerned about the multiple registration case.  Perhaps we will get future feedback that its a use case that needs to be solved, but it can be done incrementally on top of this proposal.  Nothing here precludes dealing with that use case later.  We can add additional options to register() or a separate method as you propose.

Right now, though, I don't have any developers telling me that multiple registration scope mutations is an important problem.  And it will be *very* complex and costly to make work atomically due to life cycle issues; i.e. you need to remove conflicting registrations before you know if the new installation works.  I strongly feel we should not commit to this use case without developers providing data that its worth paying the cost.

@jakearchibald and @asutherland as other folks who have chimed here do you have any opinions?

-- 
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/1512#issuecomment-707796231

Received on Tuesday, 13 October 2020 14:55:11 UTC