Page MenuHomePhabricator

Echo: Overlay menus are not removed on teardown
Open, Needs TriagePublicBUG REPORT

Assigned To
None
Authored By
Jack_who_built_the_house
Aug 26 2021, 11:47 PM
Referenced Files
F34621227: image.png
Aug 26 2021, 11:47 PM
F34621242: image.png
Aug 26 2021, 11:47 PM
F34621223: image.png
Aug 26 2021, 11:47 PM

Description

List of steps to reproduce:

  • Open any wiki where you have notifications, preferrably bundled ones, like in this pic:
    image.png (94×476 px, 4 KB)
    Bundled notifications may also come from DiscussionTools' topic subscriptions, for instance:
    image.png (96×495 px, 5 KB)
    (In my case, bundled items were ones to have overlay menus, but actually all items create a .mw-echo-ui-actionMenuPopupWidget-menu element, even if empty.)
  • Click the "Notices" notification badge once
    image.png (28×39 px, 478 B)
  • Open DevTools, search for the second .mw-echo-ui-NotificationBadgeWidget-overlay-menu element. Click on it to select it.
  • Type $0.childElementCount in the console, execute.
  • Close and open the "Notices" popup several times. Say, three.

What happens?:

  • $0.childElementCount returns a four times bigger number. This means the previous menus were not cleaned up.

What should have happened instead?:

  • $0.childElementCount should not change (unless the notification count has changed). In order to achieve that, these menus should be removed from the DOM on notification popup (or other relevant widget) teardown.

This bug has a potential of cluttering the DOM at great speed, especially given the features such as the new DiscussionTools' Topic subscriptions. (It's also how I found this bug, being surprised by hundreds of child elements with unreachable menus.)

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Jack_who_built_the_house renamed this task from Echo: Overlay menus of bundled elements are not removed on teardown to Echo: Overlay menus of bundled items are not removed on teardown.Aug 26 2021, 11:49 PM
Jack_who_built_the_house updated the task description. (Show Details)
Jack_who_built_the_house renamed this task from Echo: Overlay menus of bundled items are not removed on teardown to Echo: Overlay menus are not removed on teardown.Aug 26 2021, 11:56 PM
Jack_who_built_the_house updated the task description. (Show Details)

I originally thought this problem affects only bundled notifications, but it turned out not to be the case.