Closed Bug 1778514 Opened 1 month ago Closed 1 month ago

Avoid mutating source objects because of "relativeUrl" attribute

Categories

(DevTools :: Debugger, enhancement)

enhancement

Tracking

(firefox104 fixed)

RESOLVED FIXED
104 Branch
Tracking Status
firefox104 --- fixed

People

(Reporter: ochameau, Assigned: ochameau)

References

Details

Attachments

(1 file)

We are currently maintaining a relativeUrl attribute on source objects from here:
https://searchfox.org/mozilla-central/rev/284187d0a7130d21042beeff0af0627c8e68cacc/devtools/client/debugger/src/reducers/sources.js#356

But that's quite costly as we force cloning the map of all sources and may trigger unexpected state/component updates when maintaining this attribute.

This could easily be computed on-demand and this is only used in one callsite:
https://searchfox.org/mozilla-central/rev/284187d0a7130d21042beeff0af0627c8e68cacc/devtools/client/debugger/src/utils/quick-open.js#55

This will help bug 1777203 by ensuring that source objects are really immutable.

Assignee: nobody → poirot.alex
Status: NEW → ASSIGNED
Blocks: 1778647
Pushed by apoirot@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/cb5dc073b7e4
[devtools] Avoid mutating source objects because of relative url computation. r=bomsy
Status: ASSIGNED → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 104 Branch
Regressions: 1779966
You need to log in before you can comment on or make changes to this bug.