summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2015-12-28 18:10:46 -0800
committerStan Hu <stanhu@gmail.com>2015-12-29 13:49:44 -0800
commit59533d47dd901a1b4a7e4eda382a0a25ce9a1eef (patch)
tree3df172fb05ae95e680e2ea9c4d0779391f62fbff
parenta80f2b792cd2bdd6626bfe712750a58b863cc037 (diff)
downloadgitlab-ce-59533d47dd901a1b4a7e4eda382a0a25ce9a1eef.tar.gz
Fix project transfer e-mail sending incorrect paths in e-mail notification
The introduction of ActiveJob and `deliver_now` in 7f214cee7 caused a race condition where the mailer would be invoked before the project was committed to the database, causing the transfer e-mail notification to show the old path instead of the new one. Closes #4670
-rw-r--r--CHANGELOG3
-rw-r--r--app/models/project.rb4
2 files changed, 6 insertions, 1 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 5d0726a52ce..425beb17743 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -13,6 +13,9 @@ v 8.4.0 (unreleased)
- Revert back upvote and downvote button to the issue and MR pages
- Enable "Add key" button when user fills in a proper key (Stan Hu)
+v 8.3.3 (unreleased)
+ - Fix project transfer e-mail sending incorrect paths in e-mail notification (Stan Hu)
+
v 8.3.2
- Disable --follow in `git log` to avoid loading duplicate commit data in infinite scroll (Stan Hu)
- Add support for Google reCAPTCHA in user registration
diff --git a/app/models/project.rb b/app/models/project.rb
index 75f85310d5f..017471995ec 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -555,7 +555,9 @@ class Project < ActiveRecord::Base
end
def send_move_instructions(old_path_with_namespace)
- NotificationService.new.project_was_moved(self, old_path_with_namespace)
+ # New project path needs to be committed to the DB or notification will
+ # retrieve stale information
+ run_after_commit { NotificationService.new.project_was_moved(self, old_path_with_namespace) }
end
def owner