Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Reflow comments

Christophe Bliard6961ab55e0a5
diff --git a/app/services/notifications/create_from_model_service.rb b/app/services/notifications/create_from_model_service.rb
index f57a649bc9f..e79062956fe 100644
--- a/app/services/notifications/create_from_model_service.rb
+++ b/app/services/notifications/create_from_model_service.rb
@@ -49,14 +49,21 @@ class Notifications::CreateFromModelService
end
# Creates Notifications according to the various settings:
+ #
# * configured by the individual users
# * the send_notifications property provided
+ #
# and also by the properties of the journal, e.g.:
+ #
# * a work package mentioning a user
# * a news begin watched
- # This method might be called multiple times, mostly when a journal is aggregated.
- # On the second run, the potentially existing Notifications need to be taken into account by
- # * updating them if the user is still to be notified: resetting the read_ian to false if the strategy supports ian
+ #
+ # This method might be called multiple times, mostly when a journal is
+ # aggregated. On the second run, the potentially existing Notifications need
+ # to be taken into account by
+ #
+ # * updating them if the user is still to be notified: resetting the read_ian
+ # to false if the strategy supports ian
# * destroying them if the user is no longer to be notified
def call(send_notifications)
result = ServiceResult.new success: !abort_sending?
diff --git a/config/initializers/subscribe_listeners.rb b/config/initializers/subscribe_listeners.rb
index 76b389381ca..9f972489475 100644
--- a/config/initializers/subscribe_listeners.rb
+++ b/config/initializers/subscribe_listeners.rb
@@ -28,16 +28,18 @@
Rails.application.config.after_initialize do
OpenProject::Notifications.subscribe(OpenProject::Events::JOURNAL_CREATED) do |payload|
- # A job is scheduled that creates notifications (in app if supported) right away and schedules
- # jobs to be run for mail and digest mails.
+ # A job is scheduled immediately that creates notifications (in-app if
+ # supported) right away and schedules jobs to be run for mail and digest
+ # mails.
Notifications::WorkflowJob
.perform_later(:create_notifications,
payload[:journal],
payload[:send_notification])
- # A job is scheduled for the end of the journal aggregation time. If the journal does still exist
- # at the end (it might be replaced because another journal was created within that timeframe)
- # that job generates a OpenProject::Events::AGGREGATED_..._JOURNAL_READY event.
+ # A job is scheduled for the end of the journal aggregation time. If the
+ # journal still exists with a matching updated_at value (it might be updated
+ # because the resource was modified within that time frame), then that job
+ # generates a OpenProject::Events::AGGREGATED_..._JOURNAL_READY event.
Journals::CompletedJob.schedule(payload[:journal], payload[:send_notification])
end