Context:
With the https://gerrit.wikimedia.org/r/1202126 we made a change that potentially affects a few use cases see also T408535: Look into the failing tests when rebuilding keyIndexes. While smoke testing this on the beta cluster I could see the following regressions in some edge cases.
Regressions:
- Start with the following Wikitext
<ref>Autoname Book</ref> <ref name="ldr" /> <ref details="page 1" name="mainplus">Main+details</ref> <references> <ref name="ldr">LDR Book</ref> </references>
- Open the page for editing in VE in one tab
- Open the page for editing in VE in another tab
Inline ref:
- Select and copy the first ref [1] from the 1st tab
- Pasted it twice next to the [1] in the 2nd tab
What happens:
- As soon as we paste the 2nd time one of the added footnotes shows as [undefined]
What should happen:
- Both footnotes should show a number, different from the original
LRD ref ( no regression ):
- Start over
- Select and copy the secound ref [2] from the 1st tab
- Pasted it twice next to the [2] in the 2nd tab
- This behaves as intended
Sub-ref:
- Start over
- Select and copy the third ref [3] from the 1st tab
- Pasted it twice next to the [3] in the 2nd tab
What happens:
- As soon as we paste the 2nd time one of the added footnotes shows as [undefined]
What should happen:
- Both footnotes should show a number, different from the original
Notes:
- Generally it seems that named references do not have that issue. It seems to affect reference nodes with auto/ listKey
- From some initial pocking around it seems that ve.dm.MWReferenceNode.static.remapInternalListKeys does not work here in all cases.

