Page MenuHomePhabricator

WikibaseChangeNotification change has no statement, description and alias diffs
Closed, ResolvedPublic

Description

The function called by the WikibaseChangeNotification hook gets a change object, but the diff in the change is empty. This is because EntityChangeFactory “minimizes” the entities it receives before diffing them – that is to say, it wipes them clear:

Hack: Don't include statement, description and alias diffs, since those are unused and not helpful performance-wise to the dispatcher and change handling.

Saying those diffs are “unused” is a bold claim when we offer a hook that exposes these change objects to third-party extensions :) at the very least, this should be documented in doc/hooks.txt.

Related tasks:

  • Minimization originally introduced in T110996.
  • minimizeEntityForDiffing documentation mentions T113468, but if I understand that task correctly, the change still won’t contain a full diff when that’s implemented, just a summary, so that still needs to be documented in the hook documentation.

(My use case: the WikibaseQualityConstraints extension will soon extract constraints from statements on properties, instead of from templates on the properties’ talk pages. I’d like to do that only when there have been changes to the “property constraint” statement on the property, and not do anything when a change only affects labels or other statements.)

Event Timeline

Change 349933 had a related patch set uploaded (by Lucas Werkmeister (WMDE)):
[mediawiki/extensions/Wikibase@master] Document lack of diff in WikibaseChangeNotification change

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

Change 349933 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Document lack of diff in WikibaseChangeNotification change

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

Lydia_Pintscher moved this task from incoming to ready to go on the Wikidata board.
Lydia_Pintscher removed a project: Patch-For-Review.
Lucas_Werkmeister_WMDE claimed this task.

I think we can close this. The minimization is documented, and we have diff aspects now. It’s unlikely that we’ll ever include the full diff – the change aspects should be enough for most cases.