Page MenuHomePhabricator

Cache purge randomly doesn't work
Open, Needs TriagePublic

Description

Steps to reproduce

  1. Create an item with two statements using different properties (for example, P1 and P2).
  2. Update the MediaWiki:Wikibase-SortedProperties page specifying properties in the opposite order.

For example,

* P2
* P1
  1. Go back to the item and try to purge the page (either with ?action=purge or via Special:Purge) or update it.

Result

The order of the statements on the page in most cases remains the same. Going back on the page and purging it later may suddenly force changes take effect.

Expected Result

After the purge or page edit, the statements on the page are ordered as prescribed on the SortedProperties page.

This is potentially the problem that causes a lot of frustration here: T364744

Event Timeline

Anton.Kokh renamed this task from Page purge randomly doesn't work to Cache purge randomly doesn't work .Sep 12 2025, 3:10 PM
Anton.Kokh updated the task description. (Show Details)

There is a cache for the sort order provider
https://github.com/wikimedia/mediawiki-extensions-Wikibase/blob/master/lib/includes/Store/CachingPropertyOrderProvider.php#L13
This defaults to 3600s, so 1 hour https://github.com/wikimedia/mediawiki-extensions-Wikibase/blob/master/lib/includes/Store/CachingPropertyOrderProvider.php#L40C20-L40C24
A purge of a page will not result in this cache being busted.

A likely good path forward would be adding a new hook to look for edits of the sorted properties mediawiki page, that would just purge / re cache this cached data that is used for page renders.
Sounds easy enough, and something that should likely be applied to all Wikibases in general.