Open Bug 1246289 Opened 8 years ago Updated 3 months ago

network panel shows no error for missing file referenced in arguments to serviceWorker.register

Categories

(DevTools :: Netmonitor, defect, P3)

30 Branch
defect

Tracking

(Not tracked)

REOPENED

People

(Reporter: bwalker, Unassigned)

References

(Blocks 1 open bug)

Details

(Whiteboard: [swdev-m1])

Attachments

(1 file)

STR:

1. as of 2016-02-05, visit https://getts.ro/upup.html

Expected:

network panel will a failure to retrieve https://getts.ro/upup.sw.min.js

Actual:

network panel shows nothing
> network panel will a failure to retrieve https://getts.ro/upup.sw.min.js

that should have read "network panel will show a failure"
I don't think network panel shows requests made from within the service worker either.  Alexander, any ideas on how to fix this?
Flags: needinfo?(poirot.alex)
Firefox also doesn't show any error in the console, Chrome does.
The .register() does reject its promise, though.  Message is like this:

  TypeError: ServiceWorker script at https://blog.wanderview.com/js/upup.sw.min.js for scope https://blog.wanderview.com/js encountered an error during installation.
Its unclear to me how many exceptions and promise rejections we should auto-copy to the console.  The script author can decide how to handle them.
The network panel should track requests being intercepted by the SW and the request being made by the SW.
But it still miss the requests being made to the Service worker *script* itself, which 
https://getts.ro/upup.sw.min.js seems to be.

I highlighted this issue while globally fixing network panel for service worker.
  https://bugzilla.mozilla.org/show_bug.cgi?id=1158264#c35
This issue is that there is no way to identify to which tab a service worker script request is related.
Requests being made to the script itself are global and don't contain any context that may relates to any tab. the nsIHttpChannel object miss some critical bits, it's nsILoadContext should have a associatedWindow or topFrameElement being set by the platform code.
Flags: needinfo?(poirot.alex)
I don't know if that would be possible to tweak that in
ServiceWorkerScriptCache.cpp
  CompareNetwork::Initialize

The load group seems to be defined over here. Am It correct?
This comments seems to say we try to ensure the nsILoadContext is correct, but it looks like it isn't at the end.
http://mxr.mozilla.org/mozilla-central/source/dom/workers/ServiceWorkerManager.cpp#1805
Whiteboard: [swdev-m1]
Assignee: nobody → bhsu
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → DUPLICATE
Sorry, I was just marking this bug can be solved together with 1267119 which I currently have a WIP patch to save them both...
Status: RESOLVED → REOPENED
Resolution: DUPLICATE → ---
Per Ho-Pang, this depends on SW redesign clientID. We might need more investigation here.
Assignee: bhsu → nobody
Priority: P2 → P3
Product: Firefox → DevTools
Severity: normal → S3

Adding a working STR

  1. Go to https://service-worker-register-missing.glitch.me/
  2. Open the netmonitor
  3. Refresh to see all requests

ER

See 404 request for service worker file sw.js in the netmonitor.

AR

No request for sw.js is displayed in the netmonitor.

Attached image Chrome SW requests

Adding a screenshot from chrome, showing the request.

Depends on: 1865784
You need to log in before you can comment on or make changes to this bug.