Re: [w3c/ServiceWorker] ready promise is kind of weird after you call unregister() (#1279)

I agree this is weird. I think our hands are tied because .ready is a property, so it always needs to return the same promise. There is some historical discussion at https://github.com/w3c/ServiceWorker/issues/223 and https://groups.google.com/a/chromium.org/d/msg/blink-dev/jjh4KUS0cS0/xA8_F904UeQJ

I'm not too sure why #223 went with a property instead of a method. #223 says "it's just a state transition". I guess we didn't consider that unregister()  can transition you back to the "not ready" state.

Of course this is all a bit of an edge case, I don't think it's caused problems in the wild, and sites can detect it by checking if registration.active is null. 

-- 
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/1279#issuecomment-364660182

Received on Saturday, 10 February 2018 14:50:43 UTC