Lucas_Werkmeister_WMDE added a comment.

  Nice investigation, thank you! Now it’s making more sense.
  
  > My quick fix involves checking in the singleton getter to see if the 
`ParserOutput` object reference has changed
  
  I think this is actually a pretty good approach – the identity of the 
`ParserOutput` instance should be a fairly good proxy for “are we still in the 
same parse or not?” (which matters not just for the `ParserOutput`, but also 
for things like the `Language`, which we get from the `ParserOptions` and which 
in theory can probably change as well) – and I haven’t found a much better one 
so far. (The `ParserOutput::mParseStartTime` looks interesting, but it’s both 
deprecated and not directly accessible; its recommended replacement, 
`getTimeProfile()`, is useless during an ongoing parse IIUC. I don’t think the 
parser output or parse call really have an “ID” of their own, and many of the 
associated IDs – page, revision, whatever – are going to be the same for 
multiple parses triggered by Parsoid.)
  
  An alternative might be the `ParserClearState` hook, which is called in 
(guess what) `Parser::clearState()`. We could perhaps subscribe to that hook 
and reset the singletons in `Scribunto_LuaWikibaseEntityLibrary` and friends 
there. But at the moment I think I almost like the `ParserOutput` identity 
check better.

TASK DETAIL
  https://phabricator.wikimedia.org/T255706

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: ArthurTaylor, Lucas_Werkmeister_WMDE
Cc: ArthurTaylor, hoo, Lucas_Werkmeister_WMDE, ItamarWMDE, Ladsgroup, Krinkle, 
eprodromou, aaron, Michael, Aklapper, thcipriani, Danny_Benjafield_WMDE, 
Isabelladantes1983, Themindcoder, Adamm71, Jersione, Hellket777, LisafBia6531, 
Astuthiodit_1, 786, Biggs657, karapayneWMDE, Invadibot, maantietaja, Juan90264, 
Alter-paule, Beast1978, Un1tY, Akuckartz, Hook696, darthmon_wmde, Rosalie_WMDE, 
Kent7301, joker88john, CucyNoiD, Nandana, Gaboe420, Giuliamocci, Cpaulf30, 
Lahi, Gq86, Af420, Bsandipan, GoranSMilovanovic, QZanden, KimKelting, 
LawExplorer, Lewizho99, Maathavan, _jensen, rosalieper, Neuronton, Scott_WUaS, 
Verdy_p, Wikidata-bugs, aude, Jdforrester-WMF, Mbch331, Jay8g
_______________________________________________
Wikidata-bugs mailing list -- wikidata-bugs@lists.wikimedia.org
To unsubscribe send an email to wikidata-bugs-le...@lists.wikimedia.org

Reply via email to