Page MenuHomePhabricator

Diff does not accurately show deleted text
Open, Needs TriagePublicBUG REPORT

Description

Please see this diff: https://species.wikimedia.org/w/index.php?title=Module:Authority_control&diff=prev&oldid=9405483
It shows that two end were removed at the top (lines 558 and 559), but this isn't the case.

See also these diffs, that look correct:
https://species.wikimedia.org/w/index.php?title=Module:Authority_control/sandbox&diff=prev&oldid=9339402
https://species.wikimedia.org/w/index.php?title=Module:Authority_control/sandbox&diff=prev&oldid=9405433

But this one, between the previous revision and the last one (oldid 9339402 not shown), shows that code was removed before the --Worldcat comment, but this is not the case:
https://species.wikimedia.org/w/index.php?title=Module%3AAuthority_control%2Fsandbox&diff=9405433&oldid=9339396

Code was removed at line 560:
https://species.wikimedia.org/w/index.php?title=Module:Authority_control/sandbox&diff=prev&oldid=9405433

and not at line 558:
https://species.wikimedia.org/w/index.php?title=Module%3AAuthority_control%2Fsandbox&diff=9405433&oldid=9339396

Steps to replicate the issue:

  • Delete the "Worldcat" block and the previous blank line, including newline just after end at line 559, to line 571:

Highlighted code to delete.png (649×1 px, 139 KB)

  • Click "Show changes" to see difference with preceding revision

What happens?:

The diff shown is not accurate: the following code (before the --Worldcat comment) was not deleted:
558 end
559 end

What should have happened instead?:

The diff should show the code that was actually deleted.

Other information:

If the newline just after end at line 559 is not selected (so selection begins at line 560, to line 571), the diff correctly shows that the two end at the end of the selection have been deleted:
https://test.wikipedia.org/w/index.php?title=Module:WS_Authority_control&diff=prev&oldid=581838

Event Timeline

Korg renamed this task from Diff shown is not accurate in module namespace to Diff does not accurately show deleted text.Oct 30 2023, 12:06 AM

It is not just in the module namespace. The same problem also occurs in the main namespace:

https://test.wikipedia.org/w/index.php?title=WS_Authority_control&diff=prev&oldid=581893
The two "In" (lines 22 and 23) were not part of the selection.

https://test.wikipedia.org/w/index.php?title=WS_Authority_control&diff=prev&oldid=581907
The text "Class Class Class" (line 10) was not part of the selection.