HTTP request generated by EventSource object in a shared worker isn't visible
Categories
(DevTools :: Netmonitor, defect, P2)
Tracking
(Not tracked)
People
(Reporter: Honza, Unassigned)
References
(Blocks 2 open bugs)
Details
(Keywords: regression, Whiteboard: [necko-triaged])
Attachments
(1 file)
6.81 KB,
patch
|
Details | Diff | Splinter Review |
STR:
- Get NodeJS example SSE app from https://github.com/FarooqAR/node-sse-example
- Install on your machine (use
npm install
) - Run without a worker
node ./app.js
- Open Firefox, DevTools and select the Network panel
- Load
http://localhost:8081/
- You should see
http://localhost:8081/events/
request in the Network panel - Restart the NodeJS app in worker
node ./app.js worker
- Load
http://localhost:8081/
- The
http://localhost:8081/events/
request is not in the Network panel
Honza
Reporter | ||
Updated•4 years ago
|
Comment 1•4 years ago
|
||
:Honza, if you think that's a regression, then could you try to find a regression range in using for example mozregression?
Reporter | ||
Comment 2•4 years ago
|
||
Another and simpler STRs:
- Open DevTools and select the Network panel
- Load http://wpt.live/eventsource/dedicated-worker/eventsource-onmessage.htm
- You should see
message.py
request in the list (http://wpt.live/eventsource/resources/message.py). It's channel for server side events.
AR: message.py
request is not there
ER: message.py
request is in the list
Note that the request for SSE is done from within a web worker (not service worker). Requests from SW are not visible atm, which is covered by bug 1432311)
Honza
Reporter | ||
Comment 3•4 years ago
|
||
Some results from my analysis:
- The Network panel is filtering out requests that doesn't belong to the current page. It uses the following function
https://searchfox.org/mozilla-central/rev/9c6e7500c0015a2c60be7b1b888261d95095ce27/devtools/server/actors/network-monitor/network-observer.js#65
The function is used at many places e.g. here
https://searchfox.org/mozilla-central/rev/9c6e7500c0015a2c60be7b1b888261d95095ce27/devtools/server/actors/network-monitor/network-observer.js#365
It's clear that the request is not visible since it's filtered out.
- I put some logs in the
matchRequest
function and it looks like the channel associated with the SSE request doesn't haverequest.loadGroup
so, can't find parent window/frame etc.
We need the loadGroup
in this function
https://searchfox.org/mozilla-central/rev/9c6e7500c0015a2c60be7b1b888261d95095ce27/devtools/shared/webconsole/network-helper.js#256
You might see (in the same file) that it's used by getTopFrameForRequest
and getWindowForRequest
.
- Also note that I am seeing an exception from this place:
https://searchfox.org/mozilla-central/rev/9c6e7500c0015a2c60be7b1b888261d95095ce27/devtools/server/actors/network-monitor/network-response-listener.js#84
NS_NOINTERFACE, when querying for {2813a7a3-d084-4d00-acd0-f76620315c02}
=> nsILoadContext
Looks like nsILoadContext
is not supported by the SSE channel?
Honza
Reporter | ||
Updated•4 years ago
|
Reporter | ||
Comment 4•4 years ago
|
||
This is blocking our GSoC project so, marking as P2
Honza
Reporter | ||
Updated•4 years ago
|
Reporter | ||
Comment 5•4 years ago
|
||
I am also attaching patch with my logs, in case it would be useful.
Honza
Reporter | ||
Comment 6•4 years ago
|
||
(accidentally assigned myself, unassigned)
Note that bug 1179250 landed, which could have an impact on the NS_NOINTERFACE exception
Honza
Comment 7•4 years ago
|
||
Bugbug thinks this bug is a regression, but please revert this change in case of error.
Updated•4 years ago
|
Comment 8•4 years ago
|
||
Realistically, we won't be able to get to this in Fx77.
Reporter | ||
Comment 9•4 years ago
|
||
It's ok to have this in 78 (it's still before GSoC starts)
Honza
Comment 10•4 years ago
|
||
Just going to mention that any requests (include those from EventSource) generated in SharedWorker
s are not visible as well in network panel.
Demos:
Fetch request in a shared worker: https://farooqar.github.io/fetch-shared-worker/
EventSource in a shared worker: http://wpt.live/eventsource/shared-worker/eventsource-onmessage.htm
A bit irrelevant to this bug but may be it's also worth mentioning that we may not be able to intercept SSE events from shared workers because of different window ids (assuming the problem I mentioned above is fixed) .
https://searchfox.org/mozilla-central/source/devtools/server/actors/network-monitor/websocket-actor.js#53
Idea: If there is a way to tell if the worker is specifically a SharedWorker
(https://searchfox.org/mozilla-central/source/dom/base/EventSource.cpp#1852), may be we could notify all the service listeners regardless of which window they belong to, and then on server-side, only emit events to the one which created the request (using channel id).
Reporter | ||
Updated•4 years ago
|
Reporter | ||
Updated•4 years ago
|
Reporter | ||
Updated•4 years ago
|
Updated•2 years ago
|
Description
•