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

skipWaiting() on an installed worker should abort Install step "Wait until no service worker client is using registration." #594

Closed
mfalken opened this issue Dec 17, 2014 · 3 comments

Comments

@mfalken
Copy link
Member

mfalken commented Dec 17, 2014

This was inspired by a question on Blink's intent to ship thread for skipWaiting: https://groups.google.com/a/chromium.org/d/msg/blink-dev/IEMjiDBuMRk/-Ok7wd_Xu7QJ

I'm not sure there's a material bug here, but it might be cleaner to explicitly deal with it. Consider the sequence:

  1. Register a worker while there's an active worker with a controllee.
  2. The worker installs and reaches Install step "Wait until no service worker client is using registration"
  3. The worker calls skipWaiting(). skipWaiting invokes the Activate algorithm.

Now the worker is activated but still waiting in Install. When it's done waiting, it will invoke the Activate algorithm again. Probably skipWaiting() should abort that waiting step... though I guess there is no harm in re-entering Activate.

@foolip
Copy link
Member

foolip commented Dec 17, 2014

I overlooked step 7.7: "Run the Update State algorithm passing registration's waiting worker and installed as the arguments."

If one cannot get to the waiting step without being installed then I see how this fits together, but even if harmless it seems a bit odd to have an algorithm stuck waiting.

@jungkees
Copy link
Collaborator

Addressed the point: abe12b1. Thanks for spotting this!

@foolip
Copy link
Member

foolip commented Dec 19, 2014

That fix LGTM

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

No branches or pull requests

3 participants