Should register() trigger an update if only updateViaCache changes?

Open
#1,414 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
30/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Quiet

Research direction

Start by reading the discussion in pull request #1411 and the WPT case registration-updateviacache.https.html. Determine which register() behavior the project should specify when only updateViaCache changes, including the rejection case; done means the decision is recorded and the specification and test expectations agree.

Written by the indexing model from the issue text.

Description

Spinning off the discussion at https://github.com/w3c/ServiceWorker/pull/1411

The current spec has the following characteristics:

  • If register() changes only updateViaCache (not the script url), it triggers a byte-for-byte update check. Therefore it may or may not install a new service worker.
  • If the register() promise resolves, the registration takes the new value of updateViaCache. But if it rejects, the value is unchanged. Therefore, updateViaCache may or may not change.

It may be cleaner if updateViaCache is treated as just a setting, and it doesn't itself trigger the byte-for-byte update check. That is, a register() call that changes only updateViaCache will immediately change the property, and resolve.

According to WPT (registration-updateviacache.https.html), Safari and Firefox implement the current spec in that they trigger an update. A test for register() rejecting was just added to that file and I don't know the results yet.

What do people think? @aliams @asutherland @wanderview @youennf @jakearchibald

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

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.

More from w3c/ServiceWorker

All issues in w3c/ServiceWorker

Similar issues

More Documentation issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.