Move call to `AiRelatedSettingsChangedEvent`
Related: Rename `NamespaceSettings::UpdateService` (#444223 - closed)
AiRelatedSettingsChangedEvent
is currently emitted from NamespaceSetting::AssignAttributesServices
(changed via this MR around 03/2024 from NamespaceSettings::UpdateService
). But that service does not actually persist the change to the namespace settings, it just sets the attributes. So there is a chance that the group update (which calls NamespaceSetting::AssignAttributesServices
) is invalid and therefore fails.
As a result, we could see events published for changes that are not persisted. I suggest that we move the publish_event
action from NamespaceSettings::AssignAttributesServices
into the after_update
method in Groups::UpdateService
so that we only emit this event when the change is successful.