Page MenuHomePhabricator

Update 'cached' information when getting constraint check results from cache
Closed, ResolvedPublic

Description

Split off from T182106: Read constraint check results from cache and check freshness – after retrieving cached results from the object cache, and before returning them from the CachingResultsBuilder, the 'cached' information in all of the 'constraint' objects in the JSON response needs to be updated, including adding such information to some 'constraint' objects that don’t have it yet.

More specifically, as pointed out in T179849: Cache all constraint check results per-entity:

“commons link”, “type”, “value type”, and “unique value” results are always potentially stale (and the response we send should indicate that, see T179844); results for all other constraint types will be known to be fresh if we set up correct purging. (This means that for most constraint types, we don’t need to show the user “this result may be stale”.)

(The “correct purging” is T182104: Track entities to consider when checking whether cached constraint check result is valid, and yes, we’ve set it up.)

In other words: add 'cached' to results for ”commons link”, “type”, “value type”, and “unique value” constraints (where not already present); and update all 'cached' objects wherever they occur, just in case.

Event Timeline

Depends on T183255: Split up CachingMetadata because my idea is to move array serialization and deserialization, but only the “max age” part of the current CachingMetadata (i. e. I4b2d02196f’s CachingMetadata) should be serialized into the API response and deserialized from there, not the “depended entity IDs” part (I4b2d02196f’s DependencyMetadata).

Change 399441 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/WikibaseQualityConstraints@master] Move CachingMetadata array serialization into class

https://gerrit.wikimedia.org/r/399441

Change 399655 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/WikibaseQualityConstraints@master] Update CachingMetadata embedded in constraint check results

https://gerrit.wikimedia.org/r/399655

Change 399441 merged by jenkins-bot:
[mediawiki/extensions/WikibaseQualityConstraints@master] Move CachingMetadata array serialization into class

https://gerrit.wikimedia.org/r/399441

Change 399655 merged by jenkins-bot:
[mediawiki/extensions/WikibaseQualityConstraints@master] Update CachingMetadata embedded in constraint check results

https://gerrit.wikimedia.org/r/399655