Skip to content

Fix for: check for highlighted_diff_lines iterates over parallel_diff_lines; parallel left/right duplicates property

Thomas Randolph requested to merge defect/mr-bug-fixes into master

What does this MR do?

I've uncovered a couple of bugs in my work on !19930 (merged).

Neither of these were exposed previously because the whole diff (both Parallel and Inline) was loaded, so in both cases the other cases were scraping by.

  • In one change, there was a duplicated key .line that causes a throw. It should be line.left.xxx but it is line.line.left.xxx, which doesn't exist.
  • In the other change, a test for highlighted_diff_lines causes the code to enter a block only if parallel_diff_lines doesn't exist, but then attempts to iterate over parallel_diff_lines anyway.

For that last item, it's unlikely this block of code was ever entered, because the diffs (should) always include both parallel_ and highlighted_ lines. As part of my work on !19930 (merged), this block is actually exercised since the diffs are often only one or the other.

Screenshots

No screenshots, this is ~backstage work.

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • ~~Label as security and @ mention @gitlab-com/gl-security/appsec~~
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by Thomas Randolph

Merge request reports