-
Notifications
You must be signed in to change notification settings - Fork 313
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
why does Register algorithm step 5.3.1 check for an active worker? #856
Comments
To clarify, we don't implement this active worker check. Does chrome? |
Chrome's implementation seems to predate the spec here, and it does a check but it's slightly different: if there's no active worker, then continue to Update. Nothing about the newest worker. I think I just wanted to avoid register() triggering an update when the registration was already settled. If there's no active worker, then it's considered unsettled. Our code has a comment:
The comment mentions "no version" registrations, which should be no longer possible. Does Firefox early exit in all cases? |
We early exit if there is a newest worker and the script URL matches. We don't check the state of the newest worker or if there is an active worker. I guess I'm not opposed to the check for active, but want to understand why. With the current unified queue spec language I think the only non-active state that could match would be an installed .waiting worker. Why would we want .register() to re-download the script for a .waiting with same script URL, but not a .active? |
I guess proceeding with update could allow the waiting worker or soon-to-be installed worker to become .active, in case someone does register().then(wait for an active version). However, Chrome's current impl looks it'll only do that if the new worker is different than the waiting worker. |
Pre F2F notes: What's the behaviour change if we drop that line? |
F2F:
|
@mattto @nhiroki - please note that we confirmed during the f2f the intention is as described in 8ae780f. I noticed Chromium still has the same code shown in #856 (comment). It'd be necessary to address this change. |
Currently the Register algorithm does the following:
The check for active worker in 5.3.1 here surprises me. Why do we want to perform the network request if the newest worker matches our script URL, but is still in the process of installing/waiting?
I see that this was added in this commit, but the comment there doesn't really help me understand. I'm not sure the update step it refers to exists any more (or its been moved).
5f9b752
The text was updated successfully, but these errors were encountered: