Details
-
Bug
-
Resolution: Fixed
-
Major
-
17.9.0
-
Unit, Integration
-
Unknown
-
N/A
-
N/A
-
Description
Viewing an old revision of an extension page on an extension repository (e.g. /xwiki/bin/viewrev/Extension/Wiki%20Application?rev=91.1 on extensions.xwiki.org) can take minutes and run more than a thousand database queries.
Steps to reproduce
- On an extension repository, take an extension page with many versions in its history, whose old revisions still hold the version and dependency objects (stored on the extension page before
XWIKI-14136). - View an old revision whose lastVersion is no longer available in the current version storage of the extension.
Expected
The "Dependencies" section lists the dependencies of the revision's last version, with one lookup per dependency.
Actual
The "Dependencies" section lists the dependencies of all versions stored in the revision, and the sheet runs one query per listed dependency. On extensions.xwiki.org, revision 91.1 of Extension.Wiki Application holds 1,282 dependency objects (130 versions): the request ran 1,282 dependency lookup queries, each in its own transaction, and took 108 seconds.
Cause
ExtensionCode.ExtensionSheet gets the last version object through $services.repository.getVersionObject(id, lastVersion), which reads the current extension and version documents, not the displayed revision. When that version can't be found there, $lastVersionObject is null and $doc.getObjects('ExtensionCode.ExtensionDependencyClass', 'extensionVersion', $lastVersionObject.getValue('version')) is called with a null value, for which Document#getObjects(String, String, String) returns all objects of the class.
Attachments
Issue Links
- is related to
-
XWIKI-14136 Dedicate a different page for each version of the extension in the Repository
-
- Closed
-