From 95047f1dc7109ea7e5ebead4115ec01bb8a75ba3 Mon Sep 17 00:00:00 2001 From: Valery Sizov Date: Fri, 30 Dec 2016 17:30:01 +0200 Subject: [PATCH] Make diff discussion more reliable --- app/models/merge_request.rb | 8 +++++--- changelogs/unreleased/fix_broken_diff_discussions.yml | 4 ++++ 2 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 changelogs/unreleased/fix_broken_diff_discussions.yml diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb index 61845bf4036..83f752d6826 100644 --- a/app/models/merge_request.rb +++ b/app/models/merge_request.rb @@ -861,9 +861,11 @@ class MergeRequest < ActiveRecord::Base paths: paths ) - active_diff_notes.each do |note| - service.execute(note) - Gitlab::Timeless.timeless(note, &:save) + transaction do + active_diff_notes.each do |note| + service.execute(note) + Gitlab::Timeless.timeless(note, &:save) + end end end diff --git a/changelogs/unreleased/fix_broken_diff_discussions.yml b/changelogs/unreleased/fix_broken_diff_discussions.yml new file mode 100644 index 00000000000..4551212759f --- /dev/null +++ b/changelogs/unreleased/fix_broken_diff_discussions.yml @@ -0,0 +1,4 @@ +--- +title: Make MR-review-discussions more reliable +merge_request: +author: