-
Notifications
You must be signed in to change notification settings - Fork 316
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
should ServiceWorkerContainer.getRegistrations() check the uninstalling flag #943
Comments
I'm going to implement hiding uninstalling registrations for now. |
Jake gave me a vague head nod in IRC, so I'm going to land this in gecko with a new wpt test case. |
I agree to add checking uninstalling flag to One occasion we might have to consider is when the uninstalling registration is being reclaimed by re- |
I'm not sure its worth clearing We could expose a |
Yeah, clearing Let's keep the current behavior for
I think this is not necessary until we get some requirements from devs. |
I guess I qualify as a dev. I posted the following recently: https://lists.w3.org/Archives/Public/public-webapps/2016JulSep/0016.html - see point #5. I would like EITHER navigator.serviceWorker.getRegistrations() to not return registrations that are in the process of being uninstalled, OR for there be a way to check if a registration that was returned is in the process of being uninstalled. Fair enough? |
Sorry to have missed the point 5 there. Thanks for reminding me. Indeed, the OP is exactly around that requirement, and I agree to change it as suggested: ".getRegistrations() to not return registrations that are in the process of being uninstalled." I don't have a strong feeling about adding |
Let's talk about |
LGTM. I'm ambivalent to the uninstalling flag. |
@jungkees, that sounds good to me.
I'm not sure I understand the use case of exposing an uninstalling flag via |
I haven't come across any use case yet. I guess @wanderview might have thought it would help in case we need some way to prevent further operations on a registration when it's being uninstalled. However, I don't see any issue with the current behavior: when called on an uninstalling registration, |
One use case would be short circuiting logic if you see But in general I don't think we really need this yet. |
Currently we set the uninstalling flag when an unregister job runs but we can't remove the registration yet. For example, its still controlling a client. This flag is then used to hide the registration when someone calls
navigator.serviceWorker.getRegistration()
.We don't, however, check the uninstalling flag in
navigator.serviceWorker.getRegistrations()
. So an uninstalling registration will show up there.Is this intentional? It seems very confusing to me that the registration for your scope might show up in
getRegistrations()
, but notgetRegistration()
. I would expect them to have similar logic.Note, an uninstalling registration will still be exposed via
self.registration
in the service worker thread itself.The text was updated successfully, but these errors were encountered: