Details
-
Bug
-
Resolution: Fixed
-
Major
-
18.4.6
-
None
-
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
- relates to
-
XWIKI-24907 Importing an extension in the repository may saves a stale document and overwrites the concurrent last-version update
-
- Closed
-