-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Code comments are not invalidated if the line they reference is removed #10686
Comments
Have the same issue. If i commented line number 100 in file, and in next commit file was reduced to 90 lines, after which someone tries to reply to this comment he gets 500 error. |
The error is partially expected, you shouldn't be able to reply on outdated code comments. The underlying issue is the fact that comment is not being marked as outdated. |
Personally I'd like to reply to outdated comments, like in GitHub. |
500 error could not be expected. |
Sometimes when I add comment in pull request, I have 500 error. |
I just encountered this exact issue. Trying to reply on the comment to 67th line of the file, which has been reduced to 66 lines on the latest commit, I get:
|
Fix go-gitea#10686 Signed-off-by: Andrew Thornton <[email protected]>
* Invalidate comments when file is shortened Fix #10686 Signed-off-by: Andrew Thornton <[email protected]> * handle 1 line Signed-off-by: Andrew Thornton <[email protected]>
Backport go-gitea#11882 Fix go-gitea#10686 Signed-off-by: Andrew Thornton <[email protected]>
Backport #11882 Fix #10686 Signed-off-by: Andrew Thornton <[email protected]>
* Invalidate comments when file is shortened Fix go-gitea#10686 Signed-off-by: Andrew Thornton <[email protected]> * handle 1 line Signed-off-by: Andrew Thornton <[email protected]>
Description
The code comment is not invalidated (marked as outdated) if line it is referencing is removed by future commit. Example can be seen on https://try.gitea.io/CirnoT/checkInvalidation/pulls/1/commits. The comment was made against lines that were removed in
a25e77b1d3
however it is not marked as outdated and attempting to comment on it will raise HTTP 500:The text was updated successfully, but these errors were encountered: