commit dfdd97aa6b5eba2e464934689a9de8f43a8d5c6e parent 9d33e51dc27b3490174171e0a79686d25b6a6e08 Author: Alexandre Poirot <poirot.alex@gmail.com> Date: Tue, 7 Oct 2025 22:22:12 +0000 Bug 1991698 - [devtools] Drop toolbox actions as soon as the tools starts destroying. r=devtools-reviewers,nchevobbe Differential Revision: https://phabricator.services.mozilla.com/D267191 Diffstat:
3 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/devtools/client/framework/test/metrics/browser_metrics_debugger.js b/devtools/client/framework/test/metrics/browser_metrics_debugger.js @@ -36,6 +36,7 @@ add_task(async function () { "resource://devtools/client/shared/vendor/react-redux.js", "resource://devtools/client/shared/vendor/redux.js", "resource://devtools/client/shared/redux/subscriber.js", + "resource://devtools/client/shared/redux/middleware/ignore.js", "resource://devtools/client/shared/redux/middleware/promise.js", "resource://devtools/client/shared/redux/middleware/thunk.js", "resource://devtools/client/shared/redux/middleware/wait-service.js", diff --git a/devtools/client/framework/test/metrics/browser_metrics_webconsole.js b/devtools/client/framework/test/metrics/browser_metrics_webconsole.js @@ -39,6 +39,7 @@ add_task(async function () { "resource://devtools/client/shared/vendor/react-redux.js", "resource://devtools/client/shared/vendor/redux.js", "resource://devtools/client/shared/redux/middleware/thunk.js", + "resource://devtools/client/shared/redux/middleware/ignore.js", // React components loaded from Toolbox and Panel BrowserLoaders "resource://devtools/client/shared/components/menu/MenuButton.js", diff --git a/devtools/client/framework/toolbox.js b/devtools/client/framework/toolbox.js @@ -35,6 +35,9 @@ const { KeyCodes } = require("resource://devtools/client/shared/keycodes.js"); const { FluentL10n, } = require("resource://devtools/client/shared/fluent-l10n/fluent-l10n.js"); +const { + START_IGNORE_ACTION, +} = require("resource://devtools/client/shared/redux/middleware/ignore.js"); var Startup = Cc["@mozilla.org/devtools/startup-clh;1"].getService( Ci.nsISupports @@ -4482,7 +4485,12 @@ Toolbox.prototype = { this._removeWindowListeners(); this._removeChromeEventHandlerEvents(); - this._store = null; + if (this._store) { + // Prevents any further action from being dispatched. + // Do that late as NetMonitorAPI may still trigger some actions. + this._store.dispatch(START_IGNORE_ACTION); + this._store = null; + } // All Commands need to be destroyed. // This is done after other destruction tasks since it may tear down