Cache panel seems to be always empty
Categories
(DevTools :: Netmonitor, defect)
Tracking
(firefox-esr115 wontfix, firefox-esr128 wontfix, firefox-esr140 wontfix, firefox139 wontfix, firefox140 wontfix, firefox141 wontfix, firefox142 fixed)
People
(Reporter: ochameau, Assigned: jdescottes)
References
(Blocks 1 open bug)
Details
(Keywords: regression)
Attachments
(2 files)
STR:
- open some page having cached request, example: bugzilla or phabricator
- select one of those requests and open the cache panel
The cache panel will be empty on all requests
Comment 1•11 months ago
|
||
Mopzregression:
Last good revision: 6aff7acd8390f8d83eb15589a0ceb376cedb2416 (2021-10-28)
First bad revision: c97b176528631e697dc1c1191b1f6b4dc1e0726a (2021-10-29)
Pushlog:
https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=6aff7acd8390f8d83eb15589a0ceb376cedb2416&tochange=c97b176528631e697dc1c1191b1f6b4dc1e0726a
| Reporter | ||
Comment 2•11 months ago
|
||
This comes from:
https://searchfox.org/mozilla-central/rev/beba5cde846f944c4d709e75cbe499d17af880a4/devtools/shared/network-observer/NetworkResponseListener.sys.mjs#476
if (this.#request.fromCache || responseStatus == 304) {
where this.#request is an nsIChannel, which, I think, never exposed such a fromCache boolean.
This precise check seems to have been wrong from day 1, from bug 859051.
But we might have regressed the other condition around responseStatus in bug 1815460.
The panel was most likely only functional thanks to the second condition.
For some reason, the existing test covering this patch triggers a 304 request from JS:
https://searchfox.org/mozilla-central/source/devtools/client/netmonitor/test/browser_net_cache_details.js
and the responseStatus is set to 304, whereas it is always set to 200 in all the websites I use as example.
| Assignee | ||
Comment 3•11 months ago
|
||
// For 304 responses, the response will be replaced by the cached response
// between responseStarted and responseCompleted, which will effectively
// change the status and statusMessage.
// Until the issue linked above has been discussed and closed, we will
// cache the status/statusMessage in order to ensure consistent values
// between responseStarted and responseCompleted.
this.#status = this.#isDataURL ? 200 : this.#channel.responseStatus;
We actually had an issue with this in BiDi, and we read the responseStatus early to avoid having it replaced with 200
| Assignee | ||
Comment 4•11 months ago
|
||
And yes prior to Bug 1815460, we were reading the status from httpActivity, which was probably populated as early as possible:
(this.#request.fromCache || this.#httpActivity.responseStatus == 304)
| Assignee | ||
Comment 5•11 months ago
|
||
Updated•11 months ago
|
| Assignee | ||
Comment 6•11 months ago
|
||
| Reporter | ||
Comment 7•11 months ago
|
||
This is yet another reason why the cache panel is sometimes blank.
nsICacheStorage.asyncOpenURI would sometime never call DevTool's onCacheEntryCheck/onCacheEntryAvailable listeners.
I don't have precise STR, but reloading many times on wikipedia.org reproduces intermittently.
Comment 9•11 months ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/377035d03764
https://hg.mozilla.org/mozilla-central/rev/721a2609a1f0
Comment 10•11 months ago
|
||
The patch landed in nightly and beta is affected.
:jdescottes, is this bug important enough to require an uplift?
- If yes, please nominate the patch for beta approval.
- See https://wiki.mozilla.org/Release_Management/Requesting_an_Uplift for documentation on how to request an uplift.
- If no, please set
status-firefox141towontfix.
For more information, please visit BugBot documentation.
| Assignee | ||
Updated•11 months ago
|
Updated•10 months ago
|
Description
•