Emails are being sent with the wrong language
Summary
Currently we are only modifying I18n.locale
at the controller level, after the request has been processed we set it to the default language. For some reason it isn't being reset and mailers are using that language.
Steps to reproduce
I think it's going to be tricky given looks like it's a race condition.
What is the current bug behavior?
Some emails are not being sent in the default language
What is the expected correct behavior?
Emails should be sent in the default language
Relevant logs and/or screenshots
Output of checks
(If you are reporting a bug on GitLab.com, write: This bug happens on GitLab.com)
Results of GitLab environment info
Expand for output related to GitLab environment info
(For installations with omnibus-gitlab package run and paste the output of:
sudo gitlab-rake gitlab:env:info
)(For installations from source run and paste the output of:
sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production
)
Results of GitLab application Check
Expand for output related to the GitLab application check
(For installations with omnibus-gitlab package run and paste the output of:
sudo gitlab-rake gitlab:check SANITIZE=true
)(For installations from source run and paste the output of:
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true
)(we will only investigate if the tests are passing)
Possible fixes
(If you can, link to the line of code that might be responsible for the problem)