w3c / w3c/ServiceWorker

Clarification on what happens during a terminated activation

Open
#1,372 26 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Bikeshed
Stars
3.6k
Forks
324
Avg merge
14d 22h
Merged PRs (30d)
1

Description

Hi!

Across browsers, we are seeing different behaviors for a terminated activation.

For Chrome:
If a worker is terminated during activation, it is placed back into the 'activating' state on next browser load. The activation handlers are re-run.

For FireFox:
If a worker is terminated during activation, the worker is discarded, and re-installation is required.

For Microsoft Edge:
If a worker is terminated during activation, the worker (on next browser load) is placed into the 'activated' state. The activation handlers are not re-run.

From the spec:
https://w3c.github.io/ServiceWorker/#activation-algorithm

Note: Once an active worker is activating, neither a runtime script error nor a force termination of the active worker prevents the active worker from getting activated.

Chrome's behavior seems to be what I'd expect as a developer, but I don't think that it's well-reflected in the spec.

Thoughts?

Thanks!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the activation algorithm in the linked Service Worker specification and compare its note with the Chrome, Firefox, and Microsoft Edge behaviors described here. Review the issue discussion to determine whether the specification needs clarification and what agreed wording or behavior would constitute completion.

Written by the indexing model from the issue text.

Assessment

Domain
documentation, web-dev
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.