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

Issue 852127 link

Starred by 4 users

Issue metadata

Status: Assigned
Owner:
Last visit 28 days ago
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug



Sign in to add a comment

DevTools offline and clear cache not working with service worker in Headless Chrome

Reported by asa.kus...@gmail.com, Jun 12 2018

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.79 Safari/537.36

Steps to reproduce the problem:
Detailed steps in github repo README:
https://github.com/asakusuma/headless-chrome-sw-issues

Reproduction screencast: https://www.youtube.com/watch?v=CsPJVHv2vaw

tl;dr: Turn on offline mode, clear the cache, and fetch requests from the service worker still somehow succeeds.

What is the expected behavior?
Fetch request from service worker should fail when in offline mode after the cache is cleared.

What went wrong?
Given a simple service worker that simply forwards a fetch request, the fetch from the service worker somehow succeeds. Clearing the cache doesn't seem to be respected.

Did this work before? N/A 

Chrome version: 67.0.3396.79  Channel: n/a
OS Version: OS X 10.13.4
Flash Version: 

We discovered this issue while building some service worker tests, instrumented with the Chrome DevTools Protocol
 
Forgot to mention two key things:
1) This happens in both Chrome and Chrome Canary. The only difference is that the sw.js request actually succeeds in stable Chrome.
2) Issue is intermittent
Also forgot to mention that this issue only seems to happen in headless chrome
Labels: Needs-Triage-M67
Cc: sindhu.chelamcherla@chromium.org
Components: Internals>Headless
Labels: Needs-Feedback Triaged-ET
Unable to test this issue on reported version 67.0.3359.79 and latest canary 69.0.3457.0 using steps mentioned in https://github.com/asakusuma/headless-chrome-sw-issues. i.e: On using chrome-canary --headless --remote-debugging-port=9200 in another terminal chrome build is not launching. Attaching screenshot and screencast for reference.

@Reporter: Please check the screencast and let us know if we miss anything. Any further information on reproducing the issue would help in further triaging of the issue.

Thanks!
852127.mp4
749 KB View Download
screenshot.png
288 KB View Download
Components: Blink>ServiceWorker

Comment 6 by l...@chromium.org, Jun 13 2018

Cc: eostroukhov@chromium.org
 Issue 851752  has been merged into this issue.
@sindhu.chelamcherla thanks for the response. I don't see any interaction with the browser of devTools in the screencast, which is necessary to reproduce.

Also, the issue is intermittent. So you may need to try it several times to reproduce.
Project Member

Comment 8 by sheriffbot@chromium.org, Jun 13 2018

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding the requester to the cc list.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
https://danishled.com/debug/

an example on my personal server reduced to the bare minimum of code. After some more playing the problem is temperamental ie sometimes it works correctly but if the view-source shows the original 'online' page then devtools will ignore the offline setting.

This is duplicated comment and files from merged report.
app.js
258 bytes View Download
index.html
162 bytes View Download
serviceworker.js
341 bytes View Download
Cc: horo@chromium.org
+horo@, he might have some insights about this.

Comment 11 by horo@chromium.org, Jun 15 2018

Cc: caseq@chromium.org
+cc:caseq@

I think this is because headless Chrome doesn't support network throttling.

HeadlessNetworkDelegate::OnBeforeURLRequest() just removes "X-DevTools-Emulate-Network-Conditions-Client-Id" header.
https://chromium.googlesource.com/chromium/src/+/09a224099edfb634fee46a3871e42428c56c4665/headless/lib/browser/headless_network_delegate.cc#46


Why wouldn't headless chrome support network throttling?

And if it doesn't support network throttling, then why would the issue be intermittent? The throttling appears to work sometimes, but not always.
Owner: lushnikov@chromium.org
Status: Assigned (was: Unconfirmed)
Summary: DevTools offline and clear cache not working with service worker in Headless Chrome (was: DevTools offline and clear cache not working with service worker)

Sign in to add a comment