w3c / w3c/ServiceWorker

`updatefound` event in service worker context seems unreliable

Open
#1,255 1 comment 2 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

Currently we expose the service workers current registration as self.registration. In theory, the service worker can add an updatefound event handle on the registration to know when an event happens. This event in a service context, though, seems unreliable since it doesn't use ExtendableEvent. For example:

  1. The updatefound event does not start the service worker if its been stopped. (AFAICT)
  2. The updatefound event does not provide an event.waitUntil() method.

Should updatefound be usable in a service worker context? If so, should the browser start the worker to fire this event and should it be an ExtendableEvent? If its an ExtendableEvent, should waitUntil() delay the installation of the update?

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 examining the service worker registration behavior described in the issue, focusing on updatefound, stopped workers, ExtendableEvent, and event.waitUntil(). Compare the intended behavior for each question and document a clear specification decision for whether the event starts the worker and delays update installation.

Written by the indexing model from the issue text.

Assessment

Domain
web-dev
Issue type
Feature
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.