"Saving the comment failed" error in code review UI loses previously entered comment
Summary
During code review, saving a comment can lead to an error "Saving the comment failed". When that happens, the text area used to enter the comment is closed and the comment text is lost. I expect the text area to stay open in case of an error and the text to remain accessible.
Steps to reproduce
I am not sure how to reproduce the "Saving the comment failed" error - I assume the backend has to be offline for that. Assuming this error happens, the steps are:
- Open a Merge Request
- Go to the "Changes" tab
- Click on a line of code to leave a review comment. A text area opens.
- Enter some text.
- Click the "Add comment now" button.
- Usually now the comment is saved, but let's assume the error in saving the comment happens now.
- A red error message "Saving the comment failed" appears on top of the screen
- The text area is closed and the entered text is lost.
Example Project
This behavior does not seem to be linked to a particular project, it happens whenever saving a comment fails.
What is the current bug behavior?
When saving a comment fails, the text area used to enter it closes and the text you entered is lost.
What is the expected correct behavior?
When saving a comment fails, the text area used to enter it should stay open and the text you entered should be accessible.
To be clear, I am not complaining about the fact that the comment failed to save. I am complaining because the text area is closed and the comment is lost. If the comment failed to save, the text area should stay open so that the entered text can be saved otherwise, or a second attempt at saving can be made.
Relevant logs and/or screenshots
Sorry, it is hard to reproduce the failing save of a comment and I did not take a screenshot when this happened to me (it happened more than once, though - this is not a one-off).
Output of checks
I haven't experienced this on Gitlab.com, but on main.gitlab.in.here.com.
Results of GitLab environment info
This section assumes I am administrator of my own Gitlab installation, which I am not. Since the issue I am reporting is a UI issue I doubt the Gitlab environment is relevant. If it is, please get back to me about how I can provide this information.
Results of GitLab application Check
This section assumes I am administrator of my own Gitlab installation, which I am not. Since the issue I am reporting is a UI issue I doubt the Gitlab environment is relevant. If it is, please get back to me about how I can provide this information.