Closed Bug 1579422 Opened 5 years ago Closed 5 years ago

FilterBar's maybeUpdateLayout is called when the Console is being destroyed

Categories

(DevTools :: Console, defect, P2)

defect

Tracking

(firefox71 fixed)

RESOLVED FIXED
Firefox 71
Tracking Status
firefox71 --- fixed

People

(Reporter: nchevobbe, Assigned: nchevobbe)

Details

Attachments

(1 file)

While testing https://phabricator.services.mozilla.com/D44109 Julian found that we are dispatching an action after the destroy function was called.
This is done in the FilterBar component, where the ResizeObserver we set is triggered because (I think), the node is detached, and the width is then 0, which triggers a layout change.

it doesn't really show up in profile, but I guess it's better if we disconnect the resizeObserver if the node isn't connected anymore, and not fire an action.

Since we don't properly unmount the Console React app,
FilterBar's componentWillUnmount is never called.
This was where we planned to disconnect the resize observer,
but it was in fact never called.
So what we do in this patch instead is in the resize observer
callback, check if the observed node is connected, and if
it's not, we disconnect the resize observer.

This prevent the console from dispatching an action, that
may slow down closing the console.

Pushed by nchevobbe@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/a6d14b542c70
Disconnect FilterBar resize observer when observed node is disconnected. r=jdescottes.
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 71
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: