Discussions on unchanged lines disappear when using "Show full file" button in merge request
Summary
After expanding a diff inside a merge request to show the full file, attempting to create a discussion on an unchanged line will result in the discussion completely disappearing upon clicking "Comment" to submit it.
This behavior is similar to gitlab-ce#53175 in that the discussion box disappears after clicking the submit button, but different in that the discussion never actually gets created under the hood. In other words, moving back to the "Discussions" tab will still not reveal the discussion.
Steps to reproduce
- Open any merge request with partially changed files large enough to be expanded.
- Click the "Show full file" button to expand the diff for the full file.
- Hover over the line number for a line that was not changed in the branch under review.
- Click the button to add a comment to that line.
- Type a comment and click the "Comment" button to submit.
- Witness the comment box disappear completely.
- Check the Discussions tab to confirm that a discussion was not created for the added comment.
What is the current bug behavior?
Comment disappears on the diff view upon submission, and a new discussion is never created (discussion count never increases).
What is the expected correct behavior?
Adding the comment should result in a new discussion being created, and the comment box should not disappear from the diff view upon submission.