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
This commit is contained in:
Nicolas Chevobbe 2019-09-13 08:21:31 +00:00
Родитель 90cc5901b8
Коммит 2f8760ac4b
1 изменённых файлов: 4 добавлений и 0 удалений

Просмотреть файл

@ -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"]);
}