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

In a cluster, updating a project or an extension in the repository may be reverted by the concurrent last-version update of the page

    XMLWordPrintable

Details

    • Unit
    • Unknown
    • N/A
    • N/A

    Description

      Problem

      Importing (updating) a project in the Repository application can be silently undone: right after the import saves the project page, a second save "Updated last version of the extension" writes back the project page as it was before the import. The metadata the import just brought (name, summary, description, ...) is lost; only the last version is kept.

      Seen on extensions.xwiki.org (18.4.6) when updating the Extension.Documentation project to its 1.15 release, whose pom had a new <name> ("Documentation Application" instead of "Documentation Application - Parent POM"). History of extensions:Extension.Documentation.WebHome, all on 2026-10-07:

      • 34.1, 20:09:36, "Imported project [org.xwiki.contrib.documentation:documentation] from repository [maven-xwiki...]": ProjectClass name = "Documentation Application", lastVersion = 1.15 (correct)
      • 34.2, 20:09:36, "Updated last version of the extension": name = "Documentation Application - Parent POM" (the pre-import value), lastVersion = 1.15

      So the page kept showing the old title. Clicking "Update project" again fixed it (35.1), because lastVersion was then already 1.15 and the last-version update had nothing to save.

      Code path

      • "Updated last version of the extension" on a project page is only saved by RepositoryManager.updateLastProjectVersion(DocumentReference), which loads the project document, updates lastVersion and saves it.
      • Its only caller is ProjectUpdaterListener, on project version page events, and it is supposed to skip them while observationContext.isIn(ProjectImportStartingEvent).
      • Revision 34.2 shows that it did run during, or just after, the import, and from a project document read before the import's save (34.1).

      This is the counterpart, for projects and in the other direction, of XWIKI-24907 (fixed in 18.4.6, which extensions.xwiki.org already runs): there the import overwrote the listener's update, here the listener's update overwrites the import. As there, the exact way the listener escapes the import guard (an event fired outside the import's observation context, or overlapping executions) is not established yet.

      Expected

      Updating a project keeps the metadata it imported; the last-version update must never save a project document older than the one it is updating.

      Attachments

        Issue Links

          Activity

            People

              tmortagne Thomas Mortagne
              vmassol Vincent Massol
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: