Closed Bug 1564363 Opened 4 months ago Closed 3 months ago

Warning: Failed prop type: The prop * is marked as required in `TabboxPanel`, but its value is `undefined`

Categories

(DevTools :: Netmonitor, task, P3)

task

Tracking

(firefox70 fixed)

RESOLVED FIXED
Firefox 70
Tracking Status
firefox70 --- fixed

People

(Reporter: Honza, Assigned: nchevobbe)

Details

Attachments

(2 files)

STR

  1. Load any page e.g. google.com
  2. Select the Console panel and make sure the Requests filter is on
  3. Open the Browser Console
  4. Reload the page
  5. Expand the first HTTP request
  6. Check out the Browser Console, there are two warnings:
Warning: Failed prop type: The prop `toggleNetworkDetails` is marked as required in `TabboxPanel`, but its value is `undefined`.
    in TabboxPanel (created by MessageContainer)
    in MessageContainer (created by ConsoleOutput)
    in div (created by ConsoleOutput)
    in ConsoleOutput
    in VisibilityHandler
    in Unknown (created by Connect(Component))
    in Connect(Component) (created by App)
    in div (created by App)
    in div (created by App)
    in App
    in VisibilityHandler
    in Unknown (created by Connect(Component))
    in Connect(Component)
    in Provider react-dev.js:369:15

NetworkEventMessage resource://devtools/client/webconsole/components/Output/message-types/NetworkEventMessage.js:174
    render resource://devtools/client/webconsole/components/Output/MessageContainer.js:110

Warning: Failed prop type: The prop `openNetworkDetails` is marked as required in `TabboxPanel`, but its value is `undefined`.
    in TabboxPanel (created by MessageContainer)
    in MessageContainer (created by ConsoleOutput)
    in div (created by ConsoleOutput)
    in ConsoleOutput
    in VisibilityHandler
    in Unknown (created by Connect(Component))
    in Connect(Component) (created by App)
    in div (created by App)
    in div (created by App)
    in App
    in VisibilityHandler
    in Unknown (created by Connect(Component))
    in Connect(Component)
    in Provider

NetworkEventMessage resource://devtools/client/webconsole/components/Output/message-types/NetworkEventMessage.js:174
    render resource://devtools/client/webconsole/components/Output/MessageContainer.js:110

Honza

Type: defect → task
Priority: -- → P3

Nicolas, could you please look at this?

Is the problem around here?

NetworkEventMessage resource://devtools/client/webconsole/components/Output/message-types/NetworkEventMessage.js:174
render resource://devtools/client/webconsole/components/Output/MessageContainer.js:110

Honza

Flags: needinfo?(nchevobbe)

Yes, these props are marked as required, but we don't have them from the console.
So for example if you open the detail network panel from a console network message, select a tab and hit the esc key, you'll have the following in the console:

TypeError: this.props.openNetworkDetails is not a function TabboxPanel.js:77:18

(we could provide either mark the prop as not required, and check its availability before calling it, or declaring it in the networkMessage, and use it to collapse the message)

The other one, toggleNetworkDetails, shouldn't be required IMO, it can only be called when hideToggleButton isn't truthy (See devtools/client/netmonitor/src/components/TabboxPanel.js#114-121), and the console passes hideToggleButton: true

Flags: needinfo?(nchevobbe)
Assignee: nobody → nchevobbe
Status: NEW → ASSIGNED

This prop is only used when hideToggleButton isn't truthy.
In the case of the console, it won't ever be called, so
it's not mandatory.

We use the openNetworkDetails prop which is already in use
in the netmonitor to collapse the message if the parameter
passed to the function is falsy (i.e. the panel is already
displayed)

Depends on D37388

Thanks! Tested on Win and works nicely!
Honza

Pushed by nchevobbe@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/825dbb82f4a0
Set toggleNetworkDetails prop as non required. r=Honza.
https://hg.mozilla.org/integration/autoland/rev/8274e31c4e2f
Close the network detail on Escape. r=Honza.
Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 70
You need to log in before you can comment on or make changes to this bug.