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.)