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

    • Bug
    • Resolution: Cannot Reproduce
    • Major
    • None
    • 4.2-milestone-3
    • Event Stream
    • Unknown
    • N/A
    • N/A

    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

              surli Simon Urli
              jvdrean Jean-Vincent Drean
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: