Page MenuHomePhabricator

Issue where getModifiedRanges() can return nothing
Open, Needs TriagePublicBUG REPORT

Description

This may just be a bug specifically triggered by my own code, but it doesn't smell like it.

Steps to replicate the issue (include links if applicable):

  • Fire up VE with edit check enabled
  • Create an external hyperlink in a document and publish it
  • Edit again. Make some changes in the document so that you've got a couple of modified ranges
  • Add a breakpoint somewhere where getModifiedRanges() executes in a check.
  • Edit your hyperlink – in my case I changed an https to an http

What happens?:

  • getModifiedRanges() starts returning [] instead of

What should have happened instead?:

getModifiedRanges() should continue to return the ranges it returned before, plus a new range for the edited hyperlink

Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.): https://gerrit.wikimedia.org/r/c/mediawiki/extensions/VisualEditor/+/1108462/

Event Timeline

I need to investigate, but I suspect that this is our "don't count modified ranges if they're adjacent to removed content" behavior flaring up. It was originally implemented as part of how the reference check was supposed to behave, and it's quite likely that it shouldn't apply in most other cases...

Per what @DLynch shared with me offline, this issues seems like it could explain the following happening:

  1. Visit: https://patchdemo.wmcloud.org/wikis/a85d92a005/w/index.php?title=Douglas_Adams&veaction=edit
  2. Type `paragraph!

Expected

  1. The entire paragraph is highlighted, and the Check that explains this highlight is expanded

Actual

  1. The Check appears in the Edit Check side rail (desktop); tho it is not expanded and the paragraph within which you typed paragraph! is NOT highlighted

Example of how this breaks things: selecting text and pasting to replace it wouldn't count as being modified.

I'm not sure I explained this well – it's not just that one check disappears, it's that _every_ edit check on the page disappears