Basic skeleton of side panel for WS frames
Categories
(DevTools :: Netmonitor, enhancement, P2)
Tracking
(firefox69 fixed)
| Tracking | Status | |
|---|---|---|
| firefox69 | --- | fixed |
People
(Reporter: Honza, Assigned: tanhengyeow)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
|
47 bytes,
text/x-phabricator-request
|
Details |
Implement basic skeleton for Messages side panel. This panel is responsible for rendering list of WS frames for selected HTTP WS upgrade request.
Some comments:
- The panel should start WS listening on the backend (through WebSocketFront.start API) in componentDidMount
- The panel renders list of frames in a table (HTML table). The initial list should be fetched through WebSocketFront.getFrames API
- The panel should support light/dark themes
- The panel should be hidden behind a pref
devtools.netmonitor.features.webSockets - Check how it works in the Console panel (we might disable WS support in the Console in case of issues for now)
Honza
| Reporter | ||
Comment 1•6 years ago
|
||
Some pointers:
-
Here is the current list of side panels
https://searchfox.org/mozilla-central/rev/7556a400affa9eb99e522d2d17c40689fa23a729/devtools/client/netmonitor/src/components/TabboxPanel.js#105-171 -
An existing side panel
https://searchfox.org/mozilla-central/rev/7556a400affa9eb99e522d2d17c40689fa23a729/devtools/client/netmonitor/src/components/HeadersPanel.js#71
Honza
| Reporter | ||
Comment 2•6 years ago
•
|
||
Implementing WebSocketReducer should be part of this bug too.
There will also be new actions.
Actions to getFrame and add payload:
- WS_ADD_FRAME - this would be fired from DataProvider when a new frame (sent or received) is received from the backend
- WS_ADD_FRAME_PAYLOAD - this would be fired from WebSocketPanel when the user selects a frame in order to preview it’s payload. At this moment the LongStringActor (representing the payload) will be resolved and the action fired.
Honza
| Reporter | ||
Updated•6 years ago
|
| Assignee | ||
Comment 3•6 years ago
|
||
Implement basic skeleton of side panel for WS frames.
Comment 5•6 years ago
|
||
| bugherder | ||
Comment 6•6 years ago
|
||
I've just tested this on github / https://socket.io where it works just fine.
However on https://web-whatsapp.com / https://discordapp.com/ no frames are displayed (Use Chrome for reference)
Comment 7•6 years ago
|
||
I've just tested this on github / https://socket.io where it works just fine.
However on https://web.whatsapp.com / https://discordapp.com/ no frames are displayed (Use Chrome for reference)
| Reporter | ||
Comment 8•6 years ago
|
||
| Assignee | ||
Comment 9•6 years ago
|
||
Summary of final patch:
-
Expose
channelIdfrom the backend to correlate the corresponding upgraded HTTP request with its WebSocket frames. -
Setup React (new
WebSocketsPanelcomponent) and Redux architecture (new actions/reducers/store/selectors). -
New Redux architecture in detail:
- Actions: Added
addFramefunction of typeWS_ADD_FRAMEthat transmits thechannelIdand the WebSocket frame data. This action is executed fromFirefoxDataProvidervia theonFrameSentandonFrameReceivedmessage handlers. - Store: New object named
WebSocketsthat contains the framesMap(key = channelId, value = array of frame objects). - Reducers: Handles the action of type
WS_ADD_FRAMEand updates theWebSocketsobject with the new WebSocket frame mapped to achannelId. - Selectors: Added
getFramesByChannelIdto fetch frames of a particularchannelId. These frames would be displayed in theWebSocketsPanelcomponent.
- Actions: Added
-
New
WebSocketsPanelcomponent in detail:- If there are no frames in the
WebSocketsobject aftergetFramesByChannelIdis called, the messageNo WebSocket frames for this requestwould be shown. - If there are frames present for a
channelId, a HTML table is used to display the frames in different rows. WebSocketsPanelis only visible ifrequest.cause.type === "websocket"and the prefdevtools.netmonitor.features.webSocketsis set.
- If there are no frames in the
| Reporter | ||
Updated•6 years ago
|
Description
•