Skip to content
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

[[Activate]] issue after .replace()? #364

Closed
seanlong opened this issue Jul 9, 2014 · 4 comments
Closed

[[Activate]] issue after .replace()? #364

seanlong opened this issue Jul 9, 2014 · 4 comments
Milestone

Comments

@seanlong
Copy link

seanlong commented Jul 9, 2014

In spec [[Activate]] algorithm:

8.5 [[Activate]]
...
3. Let exitingWorker be registration.activeWorker.
4. If exitingWorker is not null, then:
    1. Wait for exitingWorker to finish handling any in-progress requests.
     ...

Issue condition:

  1. /foo.html started with sw_v1 (scope is default '/*');
  2. a registration is triggered from /bar.html like navigator.serviceWorker.register('sw_v2.js', {scope: '/foo.html'}), and sw_v2.js calls .replace() in oninstall() to trigger replacement;

Problem:
The "registration" used by step 2 is not the one used by the running foo.html, which means the "registration.activeWorker" will be null here.
Then the possible running sw_v1 worker will be replaced without 8.5.4 steps.

Should we also terminate all running workers matches the registration.scope when .replace() is called?

@jungkees
Copy link
Collaborator

jungkees commented Jul 9, 2014

Thanks for spotting this. I'll be working on it.

@KenjiBaheux
Copy link
Collaborator

@jungkees is this still current? Does the required change qualify as Impact MVP or is it merely spec details with no fundamental behavior changes?

@KenjiBaheux KenjiBaheux added this to the Version 2 milestone Oct 15, 2014
@KenjiBaheux
Copy link
Collaborator

Replace is not in scope for v1

@jungkees
Copy link
Collaborator

Addressed: 4610eac. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants