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

Importing xwiki-enterprise-ui-all without excluding the XWikiPreferences document empties the AS

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 4.2-milestone-3
    • Fix Version/s: None
    • Component/s: Event Stream
    • Labels:
      None
    • Difficulty:
      Unknown
    • Similar issues:

      Description

      To reproduce the issue:

      • Set "display hidden documents" to yes in your profile
      • Import xwiki-enterprise-ui-all.xar without excluding any document
      • Go to the wiki home, the AS is empty

      AFACT it's because of ActivityStreamImpl#getRelatedEvents() and the way it's used in the Activity macro.
      Since all the documents are updated during the same request they have the same request ID, all the events from the request are returned by getRelatedEvents(). The overwriting of XWikiPreferences triggers a deleteAttachment event (the XAR), then there's this code in the Activity macro:

      #macro(checkRelatedEvents)
        ## load related events
        #set ($relatedEvents = $xwiki.activitystream.getRelatedEvents($event))
        #if ($relatedEvents.size() > 1)
          #if ($event.type == 'update')
            #foreach ($relatedEvent in $relatedEvents)
              #if ($relatedEvent.type != 'update') <--------
                #set ($isUpdateRelatedEvent = true) 
                #break
              #end
            #end
          #end
      

      This will always match because the related events list contains an event of type deleteAttachment.
      $isUpdateRelatedEvent will always be set to true and none of the event from the import will made it to the AS.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              jvdrean Jean-Vincent Drean
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated: