New issue
Advanced search Search tips

Issue 601263 link

Starred by 1 user

Issue metadata

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



Sign in to add a comment

DevTools: Service workers upload on reload / redundant

Project Member Reported by pfeldman@chromium.org, Apr 7 2016

Issue description

Few observations on issues we might want to fix:

1) Redundant list grows, but is empty on DevTools reopen

we might want to clear the redundant entries once service worker from the same scope / with the same URL was loaded as active.

2) If I have "upload on load" checked and go from a good SW to the one that fails install, I still have an active one.

we should make sure that active SW is kicked out and developer gets the error state.
 

- Convert the Redundant tab into the log (per scope).
- If the installation fails w/ DevTools opened, we end up with the "Active (Failed)" SW in control of the page as opposed to the previous "Active" one.
- "Active (Failed)" SW should have associated network activity, execution context and errors in console present.

Comment 2 by horo@chromium.org, Apr 7 2016

Components: Blink>ServiceWorker Platform>DevTools
Project Member

Comment 3 by bugdroid1@chromium.org, Apr 7 2016

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

commit acbebdd456ad518ca697c2436d3ccd53c3649cef
Author: pfeldman <pfeldman@chromium.org>
Date: Thu Apr 07 07:40:35 2016

DevTools: display recent SW revisions on top of the list, remove stale redundant ones.

BUG= 601263 

Review URL: https://codereview.chromium.org/1862123004

Cr-Commit-Position: refs/heads/master@{#385689}

[modify] https://crrev.com/acbebdd456ad518ca697c2436d3ccd53c3649cef/third_party/WebKit/Source/devtools/front_end/resources/ServiceWorkersView.js

More investigation notes after talking to dgozman@:

- Instead of updating the SW upon reload, we should update the SW's script on reload. I.e. we recreate the dedicated worker inside SW, retain Active version in present registration. Then we reload the page and let SW control it.

- Rename Delete to Unregister
- Introduce a new checkbox "Bypass SW" next to update on reload.

Cc: dgozman@chromium.org
>> - Instead of updating the SW upon reload, we should update the SW's script on reload. I.e. we recreate the dedicated worker inside SW, retain Active version in present registration. Then we reload the page and let SW control it.

@horo: could you do that?

Comment 7 by horo@chromium.org, Apr 8 2016

Sorry, I don't understand what "recreate the dedicated worker inside SW" means.

I think we should execute 'install' and 'activate' event handlers while the page reload if "upload on load" is checked.

ServiceWorker downloads the static content of the site in the install event handler from the server to the CacheStorage.
And it deletes the old data in the activate event handler.
https://codelabs.developers.google.com/codelabs/your-first-pwapp/#5

While the developers reload the page with "upload on load", they want the CacheStorage to be updated.

Project Member

Comment 9 by bugdroid1@chromium.org, Apr 20 2016

Project Member

Comment 10 by bugdroid1@chromium.org, Apr 22 2016

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

commit 3afce45806e538c59e51fe46bf392477a044414b
Author: horo <horo@chromium.org>
Date: Fri Apr 22 01:00:01 2016

DevTools: Attach all Service Workers except for old redundant workers.

DevTools will attach all SWs in best mathcing scopes.
But redundant workers will be detached when new worker is installed.

BUG= 601263 

Review URL: https://codereview.chromium.org/1893313007

Cr-Commit-Position: refs/heads/master@{#388987}

[modify] https://crrev.com/3afce45806e538c59e51fe46bf392477a044414b/content/browser/devtools/protocol/service_worker_handler.cc
[modify] https://crrev.com/3afce45806e538c59e51fe46bf392477a044414b/content/browser/devtools/protocol/service_worker_handler.h
[modify] https://crrev.com/3afce45806e538c59e51fe46bf392477a044414b/content/browser/devtools/service_worker_devtools_agent_host.cc
[modify] https://crrev.com/3afce45806e538c59e51fe46bf392477a044414b/content/browser/devtools/service_worker_devtools_agent_host.h
[modify] https://crrev.com/3afce45806e538c59e51fe46bf392477a044414b/content/browser/devtools/service_worker_devtools_manager.cc
[modify] https://crrev.com/3afce45806e538c59e51fe46bf392477a044414b/content/browser/devtools/service_worker_devtools_manager.h
[modify] https://crrev.com/3afce45806e538c59e51fe46bf392477a044414b/content/browser/service_worker/embedded_worker_instance.cc
[modify] https://crrev.com/3afce45806e538c59e51fe46bf392477a044414b/content/browser/service_worker/embedded_worker_instance.h
[modify] https://crrev.com/3afce45806e538c59e51fe46bf392477a044414b/content/browser/service_worker/service_worker_version.cc

Status: Fixed (was: Assigned)

Sign in to add a comment