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

The user and group suggestion template queries every match instead of the first ones

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Unresolved
    • Major
    • None
    • 17.10.0
    • None
    • Unknown

    Description

      uorgsuggest.vm returns at most limit suggestions, 10 by default, but the XWQL query it runs has no limit. The template iterates the whole result set and keeps the first suggestions the current user can view, so a wiki with many matching users fetches every match to return 10 of them.

      The query is unlimited because the view right is checked after it: a limited query could return fewer viewable suggestions than asked.

      Proposal

      Fetch batches of increasing size, up to an upper limit, until enough viewable suggestions are collected or no match is left. Velocity is a poor place for that loop, so it belongs in a script service or a component, or better in a REST resource for the user and group suggestions.

      Raised while reviewing https://github.com/xwiki/xwiki-platform/pull/7269 .

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              nciausu Nicoleta Ciausu
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated: