Uploaded image for project: 'Sakai'
  1. Sakai
  2. SAK-29774

Limits in the UserEntityProvider (getEntities) seem to be incorrect



    • Type: Bug
    • Status: OPEN
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 10.6
    • Fix Version/s: None
    • Component/s: Entity Broker
    • Labels:


      This problem seems like it's been around for awhile, maybe since the beginning of the provider. In order to really test it you have to have more than 50 users in the system.

      The user api is set to work on "first" and "last", where this /direct interface is set to use parameters (generally _start and _limit). It looks like it's incorrectly manipulating the _start and _limit to try to fit into the values for first and last.

      The way the code is, it looks like there's no way to search above the first 50 users, it will always keep the first and last less than 50, keeping the set in the first 50, but there are a variety of defaults that might be set. It's good to restrict it so it doesn't return more than some number 50 forcing you to page but there is an error here back from the initial version of this code that seems break this.

      For example say you have 200 users

      • direct/user.xml?_sessionId=[SessionID]&_page=3

      You'd expect 50 users from page 3 (so 151-200 users) instead it returns an empty set.

      • direct/user.xml?_sessionId=[SessionID]&_page=2

      You'd expect 50 users from page 2, instead you get back the 10th user

      • direct/user.xml?_sessionId=[SessionID]&_start=55

      Returns the first 50 users, because it sets start to 1 since start > 50.

      There's a lot of similar problems like this in this call when using all of the parameters (_limit, _perpage, etc) based on how these are limited by the entitybroker and then passed through as "first" and "last" by this method.

        Gliffy Diagrams





                • Assignee:
                  maintenanceteam Core Team
                  jonespm Matthew Jones
                • Votes:
                  0 Vote for this issue
                  1 Start watching this issue


                  • Created:

                    Git Integration