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

Importing a project in the repository may create a duplicate project page instead of updating the existing one

    XMLWordPrintable

Details

    • Unknown
    • N/A
    • N/A

    Description

      Importing a project in the repository (the "Update project" button of a project page, or ExtensionCode.ImportProject) sometimes does not update the existing project page: it creates a new project page named after the project (e.g. Extension/OAuth2 and OpenID Connect, then Extension/OAuth2 and OpenID Connect 1 on the next try) with a copy of every version page.

      It happens on extensions.xwiki.org with org.xwiki.contrib.oidc:oidc: it works most of the time, but once it starts failing on a cluster member it keeps failing there.

      Cause

      ExtensionStore caches the result of the lookup of the page holding an extension or project id, but the cache key is only the id:

      • a lookup of the id as an extension (ExtensionCode.ExtensionClass), for example through the /repository/extensions/<id> REST endpoints or getVersionObject, caches "not found" for a project id, and the following project lookup (ExtensionCode.ProjectClass) gets that cached miss, so the import creates a new page
      • the cache is only cleared when the id property of an ExtensionCode.ExtensionClass object changes, so creating or updating a project page does not clear the stale entry
      • the key does not include the wiki either, while the lookup query only searches the current wiki

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: