Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-25696

Live Data cells leak an edit bus listener each time they are displayed

    XMLWordPrintable

Details

    • Unknown

    Description

      Each Live Data cell registers a listener on the edit bus when it is mounted (BaseDisplayer.vue, logic.getEditBus().onAnyEvent(...)) and never removes it. EditBusService has no way to unregister a listener.

      Consequences

      • Every page change, sort or filter that displays new rows adds one permanent listener per displayed cell. With 15 rows and 6 columns, 10 page changes leave about 900 listeners.
      • The listeners keep the unmounted cell components reachable, so they are never garbage collected.
      • Every edit event (start, cancel, save) calls all the listeners ever registered, so inline editing gets slower the longer the user browses the Live Data.

      Steps to reproduce

      1. Open a page with a Live Data, for instance the document index.
      2. Navigate between pages of the Live Data several times.
      3. Take a heap snapshot: the detached BaseDisplayer instances stay alive, held by the edit bus listeners.

      Expected: a cell removes its listener when it is unmounted.

      Attachments

        Issue Links

          Activity

            People

              mleduc Manuel Leduc
              mleduc Manuel Leduc
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated: