In T255706, we eventually figured out that some usage tracking was getting lost during Parsoid parses because Scribunto_LuaWikibaseEntityLibrary was holding a reference to an outdated ParserOutput instance (and adding entity usage to that instead of the current ParserOutput instance). We should investigate whether the same issue exists in:
- Scribunto_LuaWikibaseLibrary
- Scribunto_LuaWikibaseLexemeLibrary
- Scribunto_LuaWikibaseLexemeEntityLexemeLibrary
- Scribunto_LuaWikibaseLexemeEntityFormLibrary
- Scribunto_LuaWikibaseLexemeEntitySenseLibrary
- Scribunto_LuaWikibaseMediaInfoLibrary
- Scribunto_LuaWikibaseMediaInfoEntityLibrary
- Wikibase\Client\DataAccess\ParserFunctions\Runner ({{#statements:}} and {{#property:}} parser functions)
And, if the issue does exist, fix it (TBD whether that’s part of this task or a separate one).