Prevent simultaneous editing of comments and issues (#31053)

fixes #22907 

Tested:
- [x] issue content edit
- [x] issue content change tasklist
- [x] pull request content edit
- [x] pull request change tasklist

![issue-content-edit](a0828889-fb96-4bc4-8600-da92e3205812)
This commit is contained in:
metiftikci 2024-05-27 18:34:18 +03:00 committed by GitHub
parent 1ed8e6aa5f
commit aa92b13164
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
21 changed files with 172 additions and 27 deletions

View file

@ -82,7 +82,7 @@ func CreateIssueComment(ctx context.Context, doer *user_model.User, repo *repo_m
}
// UpdateComment updates information of comment.
func UpdateComment(ctx context.Context, c *issues_model.Comment, doer *user_model.User, oldContent string) error {
func UpdateComment(ctx context.Context, c *issues_model.Comment, contentVersion int, doer *user_model.User, oldContent string) error {
if err := c.LoadIssue(ctx); err != nil {
return err
}
@ -110,7 +110,7 @@ func UpdateComment(ctx context.Context, c *issues_model.Comment, doer *user_mode
}
}
if err := issues_model.UpdateComment(ctx, c, doer); err != nil {
if err := issues_model.UpdateComment(ctx, c, contentVersion, doer); err != nil {
return err
}