New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 605817 link

Starred by 1 user

Issue metadata

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



Sign in to add a comment

Invalid response to an soft update is difficult to debug

Project Member Reported by falken@chromium.org, Apr 22 2016

Issue description

Repro steps:
- Have a server that sometimes responds to sw.js with a valid worker, other times with content-type: text/html (not javascript)
- Register the worker (retry until you get the valid worker)
- Navigate to an in-scope. Watch for the soft update request in the Network tab.

When the server responded properly, everything works fine. When it gave a bad content-type, you'll see a red request in Network tab, but no clue for debugging since it says "Failed to load response data".

Note that the main page console displays "GET http://localhost:8787/sw.js net::ERR_INSECURE_RESPONSE" which is good, but it's hard to debug. When register failed, you'll see the "bad MIME type message", which is also good, but it that happen when the update failed.

The only way to see what's going on is to use netlog.

I don't know the best solution to this. We maybe could have update errors get logged in the main page console, or in the service workers view UI (the worker is never shown as redundant, probably because it failed to load). It seems desirable for the Network tab to display the response too.

Inspired by internal bug b/27994972.
 

Comment 1 by falken@chromium.org, Apr 22 2016

Step three should be "Navigate to an in-scope page." and keep reloading until you see the bad response.

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

Owner: horo@chromium.org
Status: Assigned (was: Available)
I think we should call ServiceWorkerVersion::ReportError() from ServiceWorkerWriteToCacheJob when error happens.
Project Member

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

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

commit 7498e14b76230504cc034eb6ee268eea5d91906d
Author: horo <horo@chromium.org>
Date: Mon Apr 25 05:52:40 2016

Shows the error message while fetching the SW script in the DevTools console.

This cl introduces EmbeddedWorkerMsg_AddMessageToConsole IPC message.
The browser process sends this message to the renderer to add message to the devtools console.
This behavior is similar to FrameMsg_AddMessageToConsole.

BUG= 605817 

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

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

[modify] https://crrev.com/7498e14b76230504cc034eb6ee268eea5d91906d/content/browser/service_worker/embedded_worker_instance.cc
[modify] https://crrev.com/7498e14b76230504cc034eb6ee268eea5d91906d/content/browser/service_worker/embedded_worker_instance.h
[modify] https://crrev.com/7498e14b76230504cc034eb6ee268eea5d91906d/content/browser/service_worker/service_worker_write_to_cache_job.cc
[modify] https://crrev.com/7498e14b76230504cc034eb6ee268eea5d91906d/content/common/service_worker/embedded_worker_messages.h
[modify] https://crrev.com/7498e14b76230504cc034eb6ee268eea5d91906d/content/renderer/service_worker/embedded_worker_dispatcher.cc
[modify] https://crrev.com/7498e14b76230504cc034eb6ee268eea5d91906d/content/renderer/service_worker/embedded_worker_dispatcher.h
[modify] https://crrev.com/7498e14b76230504cc034eb6ee268eea5d91906d/third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp
[modify] https://crrev.com/7498e14b76230504cc034eb6ee268eea5d91906d/third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.h
[modify] https://crrev.com/7498e14b76230504cc034eb6ee268eea5d91906d/third_party/WebKit/public/web/WebEmbeddedWorker.h

Project Member

Comment 4 by bugdroid1@chromium.org, Apr 25 2016

Labels: merge-merged-2716
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/7498e14b76230504cc034eb6ee268eea5d91906d

commit 7498e14b76230504cc034eb6ee268eea5d91906d
Author: horo <horo@chromium.org>
Date: Mon Apr 25 05:52:40 2016

Shows the error message while fetching the SW script in the DevTools console.

This cl introduces EmbeddedWorkerMsg_AddMessageToConsole IPC message.
The browser process sends this message to the renderer to add message to the devtools console.
This behavior is similar to FrameMsg_AddMessageToConsole.

BUG= 605817 

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

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

[modify] https://crrev.com/7498e14b76230504cc034eb6ee268eea5d91906d/content/browser/service_worker/embedded_worker_instance.cc
[modify] https://crrev.com/7498e14b76230504cc034eb6ee268eea5d91906d/content/browser/service_worker/embedded_worker_instance.h
[modify] https://crrev.com/7498e14b76230504cc034eb6ee268eea5d91906d/content/browser/service_worker/service_worker_write_to_cache_job.cc
[modify] https://crrev.com/7498e14b76230504cc034eb6ee268eea5d91906d/content/common/service_worker/embedded_worker_messages.h
[modify] https://crrev.com/7498e14b76230504cc034eb6ee268eea5d91906d/content/renderer/service_worker/embedded_worker_dispatcher.cc
[modify] https://crrev.com/7498e14b76230504cc034eb6ee268eea5d91906d/content/renderer/service_worker/embedded_worker_dispatcher.h
[modify] https://crrev.com/7498e14b76230504cc034eb6ee268eea5d91906d/third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp
[modify] https://crrev.com/7498e14b76230504cc034eb6ee268eea5d91906d/third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.h
[modify] https://crrev.com/7498e14b76230504cc034eb6ee268eea5d91906d/third_party/WebKit/public/web/WebEmbeddedWorker.h

Comment 5 by horo@chromium.org, Apr 28 2016

Status: Fixed (was: Assigned)

Sign in to add a comment