Page MenuHomePhabricator

Dirty diff when adding details to references that have list defined content
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue

Start with the following Wikitext:

<ref name="book" /><ref name="book" />
<ref name="comic" /><ref name="comic" />
<references>
<ref name="book">Book</ref>
<ref name="comic">Comic</ref>
</references>
  • Load VE to edit it
  • Add details to at least one ref of each type
  • Look at the source code ( e.g. by using the diff )
What happens?:

The reference list includes an empty line now that was not there before

What should have happened instead?:

There should not be an unnecessary change.

First investigation results
  • The issue seems to happen only when we have list defined refs.
  • ve.dm.MWReferenceNode.prototype.copySyntheticRefIntoReferencesList will add a synthetic main refs whenever a ref is converted no existing synthetic main ref can be found.
  • This also happens when there's already a list defined ref.

Event Timeline

Change #1212558 had a related patch set uploaded (by WMDE-Fisch; author: WMDE-Fisch):

[mediawiki/extensions/Cite@master] VE: Don't create a synth ref when there's a LDR main ref

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

Change #1212558 merged by jenkins-bot:

[mediawiki/extensions/Cite@master] VE: Don't create a synth ref when there's a LDR main ref

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

WMDE-Fisch renamed this task from Dirty diff when adding details to a copy pasted reference to Dirty diff when adding details to references that have list defined content.Dec 2 2025, 11:51 AM
WMDE-Fisch removed a project: Patch-For-Review.

Change #1216553 had a related patch set uploaded (by WMDE-Fisch; author: WMDE-Fisch):

[mediawiki/extensions/Cite@wmf/1.46.0-wmf.5] VE: Don't create a synth ref when there's a LDR main ref

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

Change #1216553 merged by jenkins-bot:

[mediawiki/extensions/Cite@wmf/1.46.0-wmf.5] VE: Don't create a synth ref when there's a LDR main ref

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

Mentioned in SAL (#wikimedia-operations) [2025-12-09T08:21:22Z] <wmde-fisch@deploy2002> Started scap sync-world: Backport for [[gerrit:1215214|ext.wikimediaEvents: Add xLab impactTest experiment-specific instrument (T407570)]], [[gerrit:1216553|VE: Don't create a synth ref when there's a LDR main ref (T411245)]]

Mentioned in SAL (#wikimedia-operations) [2025-12-09T08:23:23Z] <wmde-fisch@deploy2002> wmde-fisch, sfaci: Backport for [[gerrit:1215214|ext.wikimediaEvents: Add xLab impactTest experiment-specific instrument (T407570)]], [[gerrit:1216553|VE: Don't create a synth ref when there's a LDR main ref (T411245)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be verified there.

Mentioned in SAL (#wikimedia-operations) [2025-12-09T08:30:19Z] <wmde-fisch@deploy2002> Finished scap sync-world: Backport for [[gerrit:1215214|ext.wikimediaEvents: Add xLab impactTest experiment-specific instrument (T407570)]], [[gerrit:1216553|VE: Don't create a synth ref when there's a LDR main ref (T411245)]] (duration: 08m 56s)