Skip to content

Make enabling Silent Mode take effect immediately

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Problem

Enabling/disabling Silent Mode seems to take a minute before suppressing/allowing outbound emails. The delay is unexpected and undesirable. When enabling Silent Mode upon Geo site promotion (as in a bubble test), it needs to take effect immediately. Otherwise, outgoing communications may be sent from the silenced site.

Steps to reproduce with Mailers

  1. If using Geo, then in your primary site, run gdk tail rails-background-jobs | grep "Delivered\|Skipped delivery"
  2. Trigger various emails. For example, comment on an issue.
  3. Notice log output like Delivered mail 6424f56bcc078_6e8f3bc4-3a@Michaels-MBP.mail (2.3ms). And <gdk url>/rails/letter_opener should show delivered emails.
  4. Enable Silent mode in Admin Area > Settings
  5. Trigger various emails
  6. Notice log output continues to deliver mail for some time.
  7. After a minute or so of triggering emails, notice log output like Skipped delivery of mail 6424f5311896f_6cca3bc4-3a@Michaels-MBP.mail as perform_deliveries is false. And emails should stop appearing in <gdk url>/rails/letter_opener.
  8. Disable Silent mode
  9. Trigger various emails
  10. Notice log output continues to block mail delivery for some time.
  11. After a minute or so of triggering emails, notice log output delivers mail again

Steps to reproduce with webhooks

In addition to the impact on Silent Mode + Mailers, I think we saw this delay with webhooks too. But I'm not 100%.

Similar to above but instead of watching logs and triggering emails, you can trigger webhooks and get feedback in the UI like so:

  1. Visit a project's Settings > Webhooks
  2. Add a webhook to https://httpstat.us/200 (a test resource that always responds 200 OK) which triggers on Comments
  3. Click Test > Comments to trigger a call to the webhook

When Silent Mode is enabled, the call should fail and an error should be displayed.

Proposal

Make enabling Silent Mode take effect immediately.

Relevant code

It's unclear at the moment if the delay is with the Application Setting or with the Mailers.

Edited by 🤖 GitLab Bot 🤖