[openstreetmap/openstreetmap-website] Sort events and notifications into appropriate queues (PR #6930)

Pablo Brasero notifications at github.com
Tue Mar 24 11:33:02 UTC 2026


Fixes https://github.com/openstreetmap/openstreetmap-website/issues/6924

This is an attempt at solving the issue of Noticed enqueueing notifications in unexpected queues.

It's not the cleanest thing. Unfortunately `deliver_by` blocks can't be extended in subclasses. As a result I can't have one such block with common settings in `ApplicationNotifier`, plus others with specific settings (such as `config.method`) in the subclasses. I'll put it in my list to see if I can contribute that behaviour upstream, but no holding our breaths over that just now.

This means that, unless we repeat the block in every individual notifier, we have to declare it in `ApplicationNotifier`. I do that here, telling it to queue the emails in the `mailers` queue, as they have done until now.

Then there's the problem of each email notification needing to declare a different `config.method`. To work around this I declare `config.method` in `ApplicationNotifier`, which then delegates to a template method to implement in individual notifiers.

Finally, I configure `Noticed::EventJob` to enqueue in a new queue: `notifications`.
You can view, comment on, or merge this pull request online at:

  https://github.com/openstreetmap/openstreetmap-website/pull/6930

-- Commit Summary --

  * Enqueue notification emails in mailers queue
  * Enqueue notifications in notifications queue
  * Hopefully a helpful reminder for future integrators

-- File Changes --

    M app/notifiers/application_notifier.rb (11)
    M app/notifiers/changeset_comment_notifier.rb (7)
    A config/initializers/notifications.rb (5)

-- Patch Links --

https://github.com/openstreetmap/openstreetmap-website/pull/6930.patch
https://github.com/openstreetmap/openstreetmap-website/pull/6930.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/6930
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/6930 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20260324/e24f0159/attachment.htm>


More information about the rails-dev mailing list