New issue
Advanced search Search tips

Issue 836217 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Jun 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Blocking:
issue 678905



Sign in to add a comment

spec requires ServiceWorkerRegistration.update() to resolve to a registration object

Reported by bke...@mozilla.com, Apr 24 2018

Issue description

Version 68.0.3405.0 (Official Build) canary (64-bit)

What steps will reproduce the problem?
(1) Visit a site with a controlling service worker.
(2) Open web console.
(3) Execute:

  let r = await navigator.serviceWorker.getRegistration();
  await r.update();

What is the expected result?

The `await r.update()` should resolve to a ServiceWorkerRegistration object per the spec.

What happens instead?

It resolves to `undefined` instead.

Note, I believe this is something that changed in the spec at some point.  Implementations are a bit divided:

* Chrome resolves undefined
* Edge and safari resolve a registration object
* Firefox resolves undefined (but will resolve a registration in FF61)

I opened a spec issue for this here:

https://github.com/w3c/ServiceWorker/issues/1304


 

Comment 1 by bashi@chromium.org, Apr 25 2018

Status: Available (was: Untriaged)

Comment 2 by falken@chromium.org, Apr 28 2018

Cc: robertma@chromium.org
 Issue 837919  has been merged into this issue.

Comment 3 by falken@chromium.org, Apr 28 2018

Blocking: 678905
external/wpt/service-workers/service-worker/update-result.https.html fails due to this.

Comment 4 by falken@chromium.org, Jun 12 2018

Owner: leon....@intel.com
Status: Assigned (was: Available)
Leon: would you like to take this?

Comment 5 by leon....@intel.com, Jun 14 2018

Status: Started (was: Assigned)
Project Member

Comment 7 by bugdroid1@chromium.org, Jun 17 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ce3c472e9aa5f8f85e21d013a29d1c291853505c

commit ce3c472e9aa5f8f85e21d013a29d1c291853505c
Author: Han Leon <leon.han@intel.com>
Date: Sun Jun 17 05:30:45 2018

[ServiceWorker] Make ServiceWorkerRegistration#update() resolve to a registration object

To follow the spec, this CL lets ServiceWorkerRegistration#update()
resolve to a registration object (actually the ServiceWorkerRegistration
object itself) rather than undefined before.

Entry on the feature dashboard:
https://www.chromestatus.com/feature/5436747060084736

BUG= 836217 

Change-Id: I090d896e541e76143baa29d0b9d175a54e04ef2e
Reviewed-on: https://chromium-review.googlesource.com/1100736
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Matt Falkenhagen <falken@chromium.org>
Commit-Queue: Han Leon <leon.han@intel.com>
Cr-Commit-Position: refs/heads/master@{#567908}
[modify] https://crrev.com/ce3c472e9aa5f8f85e21d013a29d1c291853505c/content/renderer/service_worker/web_service_worker_registration_impl.cc
[modify] https://crrev.com/ce3c472e9aa5f8f85e21d013a29d1c291853505c/content/renderer/service_worker/web_service_worker_registration_impl.h
[delete] https://crrev.com/c9d7dd7f0556e1ff87b80a36f8767199e92e5398/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/update-result.https-expected.txt
[modify] https://crrev.com/ce3c472e9aa5f8f85e21d013a29d1c291853505c/third_party/blink/public/platform/modules/serviceworker/web_service_worker_registration.h
[modify] https://crrev.com/ce3c472e9aa5f8f85e21d013a29d1c291853505c/third_party/blink/renderer/modules/serviceworkers/service_worker_registration.cc
[modify] https://crrev.com/ce3c472e9aa5f8f85e21d013a29d1c291853505c/third_party/blink/renderer/modules/serviceworkers/service_worker_registration.idl

Comment 8 by falken@chromium.org, Jun 18 2018

Labels: M-69

Comment 9 by leon....@intel.com, Jun 20 2018

Status: Fixed (was: Started)

Sign in to add a comment