From 2f8760ac4b135c50c6d7fee0633dd1fd8c315746 Mon Sep 17 00:00:00 2001 From: Nicolas Chevobbe Date: Fri, 13 Sep 2019 08:21:31 +0000 Subject: [PATCH] Bug 1570476 - Don't fetch the request stacktrace in StackTracePanel's componentWillReceiveProps if the request won't change. r=Honza. This was causing an intermittent in console test because multiple requests were sent to the server, and sometimes, some of them after the connection being closed, which was making the test fail. With this patch, we only try to fetch a new stacktrace on componenetWillReceiveProps if the component will have to deal with a new request. Differential Revision: https://phabricator.services.mozilla.com/D45808 --HG-- extra : moz-landing-system : lando --- devtools/client/netmonitor/src/components/StackTracePanel.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/devtools/client/netmonitor/src/components/StackTracePanel.js b/devtools/client/netmonitor/src/components/StackTracePanel.js index 590557725c0d..0d089b4401c2 100644 --- a/devtools/client/netmonitor/src/components/StackTracePanel.js +++ b/devtools/client/netmonitor/src/components/StackTracePanel.js @@ -48,6 +48,10 @@ 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) { + return; + } fetchNetworkUpdatePacket(connector.requestData, request, ["stackTrace"]); }