Closed Bug 1612817 Opened 4 years ago Closed 4 years ago

Stack trace pane becomes empty when switching between requests in the network monitor

Categories

(DevTools :: Netmonitor, defect, P1)

70 Branch
x86_64
Linux
defect

Tracking

(firefox-esr68 unaffected, firefox72 wontfix, firefox73 fixed, firefox74 fixed)

RESOLVED FIXED
Firefox 74
Tracking Status
firefox-esr68 --- unaffected
firefox72 --- wontfix
firefox73 --- fixed
firefox74 --- fixed

People

(Reporter: transfusion, Assigned: nchevobbe)

References

(Regression)

Details

(Keywords: regression)

Attachments

(2 files)

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:70.0) Gecko/20100101 Firefox/70.0

Steps to reproduce:

Open the network monitor, open any website with more than one (JavaScript-initiated) request. Find two requests which have a stack trace available in the right pane.

Choose one of them, click on the stack trace so that it is visible, then click on the other request which is known to also have a stack trace.

Actual results:

The stack trace panel becomes blank. I have to deselect the stack trace panel (e.g. by selecting the Headers or Cookies tab) and reselect it for the stack trace to show up properly.

A video is attached.

Expected results:

I should be able to keep the stack trace tab open, switch between requests and have the correct stack trace shown automatically.

This appears to be a regression because release versions of FF, e.g. 70.0.1+build1-0ubuntu0.18.04.1 , do not seem to have this issue.

Component: Untriaged → Netmonitor
OS: Unspecified → Linux
Product: Firefox → DevTools
Hardware: Unspecified → x86_64

Quickly investigating, it looks like the stacktrace property from the request (devtools/client/netmonitor/src/components/StackTracePanel.js#63 ) is empty when switching to the second network call.
We are fetching the stacktrace for a request in componentWillReceiveProps, but first we check if we're rendering for a new request.
In order to do that, we are checking request.actor, which is always undefined, so we never fetch the stacktrace from here (we do from componentDidMount though).

The following diff fixes the issue:

diff --git a/devtools/client/netmonitor/src/components/StackTracePanel.js b/devtools/client/netmonitor/src/components/StackTracePanel.js
--- a/devtools/client/netmonitor/src/components/StackTracePanel.js
+++ b/devtools/client/netmonitor/src/components/StackTracePanel.js
@@ -51,7 +51,7 @@ class StackTracePanel extends Component 
   componentWillReceiveProps(nextProps) {
     const { request, connector } = nextProps;
     // If we're not dealing with a new request, bail out.
-    if (this.props.request && this.props.request.actor === request.actor) {
+    if (this.props.request && this.props.request.id === request.id) {
       return;
     }
     fetchNetworkUpdatePacket(connector.requestData, request, ["stackTrace"]);

Caused by Bug 1570476 (my bad!)

Keywords: regression
Priority: -- → P1
Regressed by: 1570476
Has Regression Range: --- → yes

In the StackTracePanel component we're fetching
stacktrace data on demand. In Bug 1570476 we
added a check to make sure we wouldn't fetch
the data if the same request was selected.
The issue is that the check is done on an
undefined property, and so the stacktrace
are never fetched from componentWillReceiveProps.
The test checking the stack trace data wasn't
actually doing so by triggering the UI, so the
bug wasn't caught.
This patch fixes the issue and modifies the test
so we make sure that the stacktrace is displayed
when selecting the stacktrace panel.

Assignee: nobody → nchevobbe
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Pushed by nchevobbe@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/8444c4271ed6
Fix empty Stack Trace panel when selecting another request. r=Honza.
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 74

Ryan, is it too late to request an uplift to Beta?

Flags: needinfo?(ryanvm)

We've already built the Fx73 RC build. I don't have any drivers for a respin at this point, but feel free to nominate this patch for mozilla-release approval if you want it to be considered for ride-along status.

Flags: needinfo?(ryanvm) → needinfo?(nchevobbe)

Honza, Bomsy, do you think this should be lifted all the way up to release?

Flags: needinfo?(odvarko)
Flags: needinfo?(nchevobbe)
Flags: needinfo?(hmanilla)

Comment on attachment 9124060 [details]
Bug 1612817 - Fix empty Stack Trace panel when selecting another request. r=Honza.

Beta/Release Uplift Approval Request

  • User impact if declined: Only DevTools users (web developers) impacted. Stack trace info not available for HTTP requests in some cases.
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Low risk, only DevTools users & one-liner patch.
  • String changes made/needed:
Flags: needinfo?(odvarko)
Attachment #9124060 - Flags: approval-mozilla-release?

Good point Nicolas, asking for uplift. It's annoying bug and low risk patch.
Honza

Flags: needinfo?(hmanilla)

LGTM for fix-optional. If we need to spin another build for release this would be good to include.

Comment on attachment 9124060 [details]
Bug 1612817 - Fix empty Stack Trace panel when selecting another request. r=Honza.

Fixes a Netmonitor bug which can cause stack traces to appear empty in some circumstances. Approved for 73.0 RC2.

Attachment #9124060 - Flags: approval-mozilla-release? → approval-mozilla-release+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: