Page MenuHomePhabricator

VE LinkCache is unclear about expected behaviour with _missing micro-cache
Open, Needs TriagePublic

Description

In T106819 we implemented a micro-cache to quickly populate which link were missing (class=new / redlinks). However once this is populated this data is always used by #styleElement and additional data is never fetched. This means if I create a new redirect link in VE, the mw-redirect class is not applied:

  1. Open a page containing a link to a redirect page.
  2. Create another link to that redirect page
  3. Observe that the newly created link is missing the mw-redirect class.

In ve.ce.MWInternalLinkAnnotation.prototype.updateClasses we already bypass using LinkCache#styleElement by setting the new class directly if that DOM node came directly from Parsoid (and therefore already has classes set).

Given that I'm not sure there is much use for the microcache anymore.

Event Timeline

Change #1140647 had a related patch set uploaded (by Esanders; author: Esanders):

[mediawiki/extensions/VisualEditor@master] LinkCache: Skip the "missing link" microcache in certian cases

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

Change #1140647 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] LinkCache: Skip the "missing link" microcache in certain cases

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