Open Bug 1747465 Opened 4 years ago Updated 4 years ago

For some reason _openPopupIfDataReady gets called multiple times when initially opening the downloads panel automatically as the result of a download

Categories

(Firefox :: Downloads Panel, defect, P3)

Desktop
All
defect

Tracking

()

People

(Reporter: Gijs, Unassigned)

References

(Blocks 1 open bug)

Details

(Whiteboard: [fidefe-mr11-downloads])

This doesn't really make sense - it appears we end some batched changes multiple times and that trips the same code. The re-entrancy protection that's there (that checks a property that effectively mirrors the panel's state):

  _openPopupIfDataReady(openedManually) {
    // We don't want to open the popup if we already displayed it, or if we are
    // still loading data.
    if (this._state != this.kStateWaitingData || DownloadsView.loading) {
      return;
    }

(searchfox)

isn't helping because it happens so quickly that we haven't yet finished showing the panel the second/third time we're invoked.

The severity field is not set for this bug.
:mak, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(mak)

P3/S3 but we may need to sort this out to fix the intermittent.

Severity: -- → S3
Flags: needinfo?(mak)
Priority: -- → P3
See Also: → 1747162

Cross referencing a comment I made in bug 1747162 in case it comes in handy:

...it appears I forgot to take into account onViewLoadCompleted(). It calls this._openPopupIfDataReady(), however without a [defined] openedManually parameter. Thus, this may explain why openedManually is initially set to undefined before updating to an appropriate true or false boolean. Furthermore, that could cause flakey results with the falsy condition set up in downloads.js.

onViewLoadCompleted()
falsy condition

You need to log in before you can comment on or make changes to this bug.