Updated mediawiki/extensions Project: mediawiki/extensions/Flow…


Updated mediawiki/extensions Project: mediawiki/extensions/Flow b8ea7b84be25f71b859718805a12bf8b7f8abedf

Fix removal/addition of categorylinks

A couple of things lead to categorylinks not properly being updated
when categories changed:

  • The listener wanted to update categorylinks (via LinksTableUpdater) before the data was actually stored to cache. Should usually be fine since we're writing to cache (and even reading that data as long as it's not committed), but safer would be to defer until data has been committed to DB (for when there's no cache, it's cleared elsewhere, it fails, ...) If it has to read from DB before it was committed, it would read the existing data & not pick up the changes.
  • Cache was not properly being updated. We currently have a nullable column in production (ref_src_wiki) to prepare for upcoming changes. Current code is not yet aware of that column. When filling cache with data read from DB, ref_src_wiki is included. When changing the data, the code doesn't know about it. It tries to array_find() different things and doesn't find the existing row and is unable to update it. Changed it to fetch the schema from the first row in cache, and make the new row match the schema. Should be ok for nullable columms that are otherwise of no importance. And if there are meaningful schema changes, we should alter cache key anyway.
  • Since we have bad data in cache ATM, I updated the cache keys.
  • Not entirely related, but when reading from DB & writing to cache, we should also normalize (roundtrip to- & fromStorageRow) the data. It should store what the code knows about, not what the DB schema happens to look like.
  • Maintenance script to fix incorrect existing categorylinks etc.
  • Removed an expensive & potentially erroneous fallback path in TopicHistoryIndex::findTopicRootId. It was used in some test (which I fixed), and I couldn't find other occurences anymore.

Most important changes are in:
FeatureIndex.php (#4)
TopKIndex.php (#2)
ReferenceRecorder.php (#1)
FlowFixLinks.php (#5)
The rest of the changes are mostly because I had to pass $mapper
along to the indices (#4)

Bug: T94569
Change-Id: I23147fd711425e770369f092ad25d0de2d354c2f