Skip to content

Commenting on MR Changes with Hide whitespace changes 'on' does not work (422 error)

Summary

Commenting on lines that have no diffs on the Changes tab of MRs in the Hide whitespace changes mode (?w=1) does not work. However when commenting on a line where a diff is present it works correctly.

Steps to reproduce

  • Create a merge request with a line of diff.
  • View it with Hide whitespace changes mode (append ?w=1 at the end of the url)
  • comment a line that was not impacted by the diff (in whitespace mode - but surely impacted in real)

Expected behavior

The comment should be saved.

Actual behavior

no comment is added to the merge request.

Relevant logs and/or screenshots

The api responds with

{"valid":false,"award":false,"errors":{"diff_line":["can't be blank"],"line_code":["can't be blank","must be a valid line code"]}}
Edited by Jay McCure