Closed Bug 1940998 Opened 1 month ago Closed 1 month ago

network overrides state leaks across toolboxes

Categories

(DevTools :: Debugger, defect)

defect

Tracking

(firefox136 fixed)

RESOLVED FIXED
136 Branch
Tracking Status
firefox136 --- fixed

People

(Reporter: jdescottes, Assigned: jdescottes)

References

Details

Attachments

(2 files)

STRs:

  • set script override on a file
  • close and reopen toolbox

ER:
Override should no longer be applied, purple dot should not be displayed in the debugger.

AR:
Override is not applied but the debugger is still showing the purple icon

This is because:

  • devtools/client/framework/reducers/network-overrides.js creates initialReducerState as a singleton shared by all toolboxes
  • we directly mutate mutableOverrides when updating the state

It was intended to make the state mutable here, but we should get rid of the initialReducerState which leads to unintentionally leaking the overrides across toolboxes.

The current classname "override" is generic and hard to grep.
This will allow to use it in tests a bit more sanely

Assignee: nobody → jdescottes
Status: NEW → ASSIGNED

Depends on D233897

Modules such as devtools/client/framework/reducers/network-overrides.js are only
loaded once, making the initial state a singleton.

If we mutate this, it will therefore apply to all toolboxes until the browser is
closed.

Pushed by jdescottes@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/e57cb85ece9e [devtools] Use more specific classname for script override icon in debugger r=devtools-reviewers,bomsy https://hg.mozilla.org/integration/autoland/rev/4c700f28e869 [devtools] Do not update the initial state for the network overrides reducer r=devtools-reviewers,nchevobbe
Status: ASSIGNED → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 136 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: