Bug 1717050 Comment 0 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

```
./mach mochitest devtools/client/netmonitor/test/browser_net_initiator.js --setpref devtools.target-switching.server.enabled=true
```
Fails to open the stack trace for the 4th request, xhr_request:
https://searchfox.org/mozilla-central/source/devtools/client/netmonitor/test/browser_net_initiator.js#44-50
The test times out on:
https://searchfox.org/mozilla-central/source/devtools/client/netmonitor/test/browser_net_initiator.js#180-184
```
    // Clicking on the initiator column should open the Stack Trace panel
    const onStackTraceRendered = waitUntil(() =>
      document.querySelector("#stack-trace-panel .stack-trace .frame-link")
    );
    await onStackTraceRendered;
```
because we happen to receive the NETWORK_EVENT resource  *before* the STACKTRACE one.

That's an issue because `networkEvent.cause.stacktraceAvailable` isn't set to true, as we expect the order to always be consistent over here:
```
./mach mochitest devtools/client/netmonitor/test/browser_net_initiator.js --setpref devtools.target-switching.server.enabled=true
```
Fails to open the stack trace for the 4th request, xhr_request:
https://searchfox.org/mozilla-central/source/devtools/client/netmonitor/test/browser_net_initiator.js#44-50
The test times out on:
https://searchfox.org/mozilla-central/source/devtools/client/netmonitor/test/browser_net_initiator.js#180-184
```
    // Clicking on the initiator column should open the Stack Trace panel
    const onStackTraceRendered = waitUntil(() =>
      document.querySelector("#stack-trace-panel .stack-trace .frame-link")
    );
    await onStackTraceRendered;
```
because we happen to receive the NETWORK_EVENT resource  *before* the STACKTRACE one.

That's an issue because `networkEvent.cause.stacktraceAvailable` isn't set to true, as we expect the order to always be consistent over here:
https://searchfox.org/mozilla-central/rev/b172dd415c475e8b2899560e6005b3a953bead2a/devtools/client/netmonitor/src/connector/firefox-data-provider.js#334-337
Ultimately, the stacktrace panel is kept hidden because of this code:
https://searchfox.org/mozilla-central/rev/b172dd415c475e8b2899560e6005b3a953bead2a/devtools/client/netmonitor/src/components/TabboxPanel.js#220

We should either try to ensure that the server *always* emit STACKTRACE *before* NETWORK_EVENT -or- accomodate to the two order in the frontend.

Back to Bug 1717050 Comment 0