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

Issue 669719 link

Starred by 5 users

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Aug 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 2
Type: Bug


Show other hotlists

Hotlists containing this issue:
dmurph-iterative-side-tasks


Sign in to add a comment

Inspector's view of cache-storage is out of sync with current state of cache

Reported by matt.t.g...@gmail.com, Nov 30 2016

Issue description

UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2902.0 Safari/537.36

Steps to reproduce the problem:
1. Grab the 'sw-preaching' branch from https://github.com/googlechrome/sw-helpers/
2. Start test server with 'node ./utils/dev-server.js'
3. Load: http://localhost:8080/packages/sw-precaching/test/browser-unit/?grep=sw-precaching%20Test%20Revisioned%20Caching%20should%20cache%20and%20fetch%20files

What is the expected behavior?
The cache storage for sw-precache-v1-http://locahost.... should have 4 entries.

What went wrong?
It's empty instead of having the four entries. You can check the entries with the adding the following to the console: 

caches.keys().then((cacheNames) => caches.open(cacheNames[0])).then((openCache) => openCache.keys()).then((keys) => console.log(keys))

Did this work before? N/A 

Chrome version: 56.0.2902.0  Channel: n/a
OS Version: 
Flash Version: Shockwave Flash 24.0 r0
 
Components: -Platform>DevTools Blink>Storage>CacheStorage
Labels: M-56

Comment 3 by jsb...@chromium.org, Nov 30 2016

Is this bug about the cache itself not having the entries, or the display of the cache in devtools not showing the entries?

(Sorry, not set up to repro at the moment.)

It's devtools that doesn't have the entries.
Cc: rbasuvula@chromium.org
Labels: TE-NeedsTriageHelp
This looks like out of scope for TE, hence adding the respective label for it to  triage further.
Components: Platform>DevTools
I don't suppose you have a more minimal repro?

Do the cache entries appear if you refresh? Right click on Cache Storage > Refresh Caches.


Labels: Needs-Feedback
Can you provide a smaller repro? Or a spot where this is already set up? I suspect, especially if this is the first load, that the cache didn't have the resources when the devtools resources window was opened.

The cache storage window doesn't actively listen to changes, it just takes a snapshot of the current state when that tab is selected. You can refresh the cache by right clicking, does that load them?
Yes the cache does update after hitting refresh, although I'm currently seeing that creating and deleting caches does mean duplicate cache names appear in devtools when only one should be visible.

Would it be worth rephrasing this bug to:

Expectation:
1. When selecting the dropdown arrow next to 'Cache Storage' I expect the UI to be updated before showing me results.
2. When selecting a cache name I expect the results to be updated before showing me the cache contents.

Actual:
1. Clicking on drop down shows me old state when the page or devtools was opened.
2. Clicking on a cache can show nothing if the cache was removed and recreated OR shows outdated results for the cache.

If manual interaction is expected perhaps the UI could be tweaked to be more user friendly. Refreshing cache names behind a right click feels hidden.
Summary: Inspector's view of cache-storage is out of sync with current state of cache (was: Cache-Storage is out of sync with current state of cache)
Cc: allada@chromium.org
Status: Untriaged (was: Unconfirmed)
Sounds like the code is behaving as intended by the authors (doesn't update), but users would like to see the UI update to reflect changes automatically.

A prominent 'refresh' button somewhere in the existing UI might be an interim solution?
Owner: dmu...@chromium.org
dmurph could you help us out?
Cc: jsb...@chromium.org
ah yeah - you can update all of cache storage by right clicking on the 'cache storage' row on the left...

This can definitely be better. I believe that this is a small-ish task (having it update when you click on the table or the cache name), but I don't remember the code super well. It might just be a call to 'refresh_()' on the model.

I can take a look at this, but I can't guarantee anything done until mid-Q1 (finishing up some high priority projects right now).

+jsbell

Cc: seththompson@chromium.org pfeldman@chromium.org
+pfeldman, +seththompson

We may want to look at auto-refreshing all storage views in devtools when the contents change, or e.g. indicating the view is dirty (a * or something, dunno). I'll add something to an (internal only, sorry) doc tracking possible devtools work on storage.

Status: Assigned (was: Untriaged)
Labels: dmurph-iterative-side-tasks
Cc: paulir...@chromium.org eostroukhov@chromium.org
 Issue 668280  has been merged into this issue.
Labels: -M-56 M-59
Owner: eostroukhov@chromium.org
Here's a tiny repro if you'd like to test the behavior. You can clone the repo and run a local server, it shouldn't require any dependencies.
https://github.com/robdodson/tiny-service-worker-app

I noticed if you refresh the page the dropdown arrow for caches disappears completely. I think this may be a bug. I wrote a code lab on the Application panel a while back and don't recall experiencing this behavior.
Regarding the arrow disappearing completely, this has been causing issues for me and I can replicate this on 59.0.3054.0 (Official Build) canary (64-bit). Is this the same issue being described here?

I am less concerned about the values in the table auto-refreshing, as long as there is a way to manually refresh. This isn't possible without the arrow.

To reproduce either, have devtools open;
1. Have devtools open, visit a page where you expect the Cache Storage to be populated and note that the arrow never appears.
2. Even if the arrow appears next to Cache Storage, refresh the page and note the arrow disappears.

To work-around this/verify, if you refresh devtools (focus and press alt/option+r), the arrow then does appear next to Cache Storage.
Right clicking the cache should give you an option to refresh and then view the contents.

I think I've raised a seperate issue to raise this UI to to an refresh icon rather than hidden behind a right click.
RE #21 - Thanks. Do you have a link to this as I can't find it, and would like to star it.
Labels: -dmurph-iterative-side-tasks
Cc: kavvaru@chromium.org jbanavatu@chromium.org
 Issue 725149  has been merged into this issue.
Cc: kristip...@chromium.org
Not quite a dup (not live updating), but Kristi is adding a refresh button to the cache storage category view, which will update the cache list when clicked.
https://bugs.chromium.org/p/chromium/issues/detail?id=727920
Project Member

Comment 26 by bugdroid1@chromium.org, Aug 28 2017

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

commit 7b37507e478439d6aa77930966357b7071081b8a
Author: Eugene Ostroukhov <eostroukhov@chromium.org>
Date: Mon Aug 28 22:26:16 2017

[DevTools] Live update SW cache entries

Bug:  669719 
Change-Id: Ibe99c22fb6748250dbfa6c7135d0b8588df4168f
Reviewed-on: https://chromium-review.googlesource.com/627716
Commit-Queue: Eugene Ostroukhov <eostroukhov@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Reviewed-by: Andrey Kosyakov <caseq@chromium.org>
Cr-Commit-Position: refs/heads/master@{#497901}
[modify] https://crrev.com/7b37507e478439d6aa77930966357b7071081b8a/content/browser/devtools/protocol/storage_handler.cc
[modify] https://crrev.com/7b37507e478439d6aa77930966357b7071081b8a/third_party/WebKit/LayoutTests/http/tests/inspector/cache-storage/cache-live-update-cache-content-expected.txt
[modify] https://crrev.com/7b37507e478439d6aa77930966357b7071081b8a/third_party/WebKit/LayoutTests/http/tests/inspector/cache-storage/cache-live-update-cache-content.html
[modify] https://crrev.com/7b37507e478439d6aa77930966357b7071081b8a/third_party/WebKit/LayoutTests/http/tests/inspector/cache-storage/cache-storage-test.js
[modify] https://crrev.com/7b37507e478439d6aa77930966357b7071081b8a/third_party/WebKit/Source/devtools/front_end/resources/ApplicationPanelSidebar.js
[modify] https://crrev.com/7b37507e478439d6aa77930966357b7071081b8a/third_party/WebKit/Source/devtools/front_end/resources/ServiceWorkerCacheViews.js
[modify] https://crrev.com/7b37507e478439d6aa77930966357b7071081b8a/third_party/WebKit/Source/devtools/front_end/sdk/ServiceWorkerCacheModel.js

Status: Fixed (was: Assigned)

Sign in to add a comment