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

Roster doesn't display when two users with same display name are in site

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Verified
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 12.3
    • Fix Version/s: 12.4, 19.0
    • Component/s: Roster
    • Labels:
      None
    • 12 status:
      Resolved
    • Test Plan:
      Hide

      Add two users with identical display names as role:Student to a course site

      Go to Roster tool

      Does roster tool load correctly with both identically-named users?

      Show
      Add two users with identical display names as role:Student to a course site Go to Roster tool Does roster tool load correctly with both identically-named users?

      Description

      Steps to replicate:

      1) Create two users with same exact first name and last name
      2) Add the users to a course
      3) Add Roster tool to course site

      Here is the frontend console error:

      Uncaught TypeError: Cannot read property 'data' of null
      at Object.success (roster.js:771)
      at i (jquery.js:3232)
      at Object.fireWith [as resolveWith] (jquery.js:3362)
      at y (jquery.js:9840)
      at XMLHttpRequest.c (jquery.js:10311)

      Here is the backend error:

      2018-09-07 13:57:35,520 ERROR http-apr-8088-exec-157 org.sakaiproject.roster.impl.SakaiProxyImpl - Exception whilst retrieving search index for site '148691f0-8838-40e5-9dc9-5ae262364d93'. Returning null ...
      java.lang.IllegalStateException: Duplicate key 8fdead0a-ae10-4ee2-a7ff-be2d3c651186
              at java.util.stream.Collectors.lambda$throwingMerger$0(Collectors.java:133)
              at java.util.HashMap.merge(HashMap.java:1254)
              at java.util.stream.Collectors.lambda$toMap$58(Collectors.java:1320)
              at java.util.stream.ReduceOps$3ReducingSink.accept(ReduceOps.java:169)
              at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382)
              at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
              at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
              at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
              at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
              at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
              at org.sakaiproject.roster.impl.SakaiProxyImpl.getSearchIndex(SakaiProxyImpl.java:1169)
              at org.sakaiproject.roster.tool.entityprovider.RosterSiteEntityProvider.getSearchIndex(RosterSiteEntityProvider.java:310)
              at sun.reflect.GeneratedMethodAccessor3900.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:498)
      

      The display name just seems like the wrong index for this Map:

      1241             if (MapUtils.isEmpty(index)) {
      1242                 final List<RosterMember> membership = getMembership(userId, siteId, groupId, roleId, enrollmentSetId, enrollmentStatus);
      1243                 index = membership.stream().collect(Collectors.toMap(RosterMember::getDisplayName , RosterMember::getUserId));
      1244                 cache.put(siteId+groupId, index);
      1245             }
      

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  farreri Miguel Pellicer
                  Reporter:
                  ottenhoff Sam Ottenhoff
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  5 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Git Source Code