Use non-sticky writes in mailer for SentNotification
What does this MR do and why?
This MR wraps SentNotification.record
with without_sticky_writes
via a helper method called record_without_sticking
.
The write for SentNotification
is not used in ActionMailer
logic flow. It is read in other workflows like handling replies to emails:
➜ gitlab git:(sc1-sentnofitication-non-sticky-record) rg SentNotification.for
lib/gitlab/email/handler/unsubscribe_handler.rb
48: @sent_notification ||= SentNotification.for(reply_token)
lib/gitlab/email/handler/create_note_handler.rb
49: @sent_notification ||= SentNotification.for(mail_key)
app/controllers/sent_notifications_controller.rb
10: @sent_notification = SentNotification.for(params[:id])
See #403257 (comment 1334882495)
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
Before | After |
---|---|
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.