This issue has been created
 
 
XWiki Platform / cid:jira-generated-image-avatar-d3d13052-503c-4750-b358-dedd29f20d51 XWIKI-25208 Open

Updating a project in the repository may be reverted by the concurrent last-version update of the project page

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-9b0afc6d-5fdc-4dbf-9f6e-868dfb804fdd Vincent Massol created this issue on 07/Oct/26 22:38
 
Summary: Updating a project in the repository may be reverted by the concurrent last-version update of the project page
Issue Type: cid:jira-generated-image-avatar-d3d13052-503c-4750-b358-dedd29f20d51 Bug
Affects Versions: 18.4.6
Assignee: Unassigned
Components: Repository
Created: 07/Oct/26 22:38
Priority: cid:jira-generated-image-static-major-bd6df539-0094-4351-9d19-1dc4205326a6 Major
Reporter: Vincent Massol
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.