Skip to content

Commit aef2e2f

Browse files
committed
Fix action notifier issue's num comment
1 parent 9efc119 commit aef2e2f

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

services/actions/notifier.go

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -263,11 +263,6 @@ func (n *actionsNotifier) CreateIssueComment(ctx context.Context, doer *user_mod
263263
func (n *actionsNotifier) UpdateComment(ctx context.Context, doer *user_model.User, c *issues_model.Comment, oldContent string) {
264264
ctx = withMethod(ctx, "UpdateComment")
265265

266-
if err := c.LoadIssue(ctx); err != nil {
267-
log.Error("LoadIssue: %v", err)
268-
return
269-
}
270-
271266
if c.Issue.IsPull {
272267
notifyIssueCommentChange(ctx, doer, c, oldContent, webhook_module.HookEventPullRequestComment, api.HookIssueCommentEdited)
273268
return
@@ -278,11 +273,6 @@ func (n *actionsNotifier) UpdateComment(ctx context.Context, doer *user_model.Us
278273
func (n *actionsNotifier) DeleteComment(ctx context.Context, doer *user_model.User, comment *issues_model.Comment) {
279274
ctx = withMethod(ctx, "DeleteComment")
280275

281-
if err := comment.LoadIssue(ctx); err != nil {
282-
log.Error("LoadIssue: %v", err)
283-
return
284-
}
285-
286276
if comment.Issue.IsPull {
287277
notifyIssueCommentChange(ctx, doer, comment, "", webhook_module.HookEventPullRequestComment, api.HookIssueCommentDeleted)
288278
return
@@ -291,6 +281,7 @@ func (n *actionsNotifier) DeleteComment(ctx context.Context, doer *user_model.Us
291281
}
292282

293283
func notifyIssueCommentChange(ctx context.Context, doer *user_model.User, comment *issues_model.Comment, oldContent string, event webhook_module.HookEventType, action api.HookIssueCommentAction) {
284+
comment.Issue = nil // force issue to be loaded
294285
if err := comment.LoadIssue(ctx); err != nil {
295286
log.Error("LoadIssue: %v", err)
296287
return

0 commit comments

Comments
 (0)