Skip to content

A platform for community discussion. Free, open, simple.

FIX: the notification data on the client expects an identifier (#18850)

Joffrey JAFFEUX9ff091dc01ed
diff --git a/plugins/chat/app/jobs/regular/chat_notify_mentioned.rb b/plugins/chat/app/jobs/regular/chat_notify_mentioned.rb
index 69a02fa6bc7..523d3259f2f 100644
--- a/plugins/chat/app/jobs/regular/chat_notify_mentioned.rb
+++ b/plugins/chat/app/jobs/regular/chat_notify_mentioned.rb
@@ -51,6 +51,7 @@ module Jobs
when :global_mentions
data[:identifier] = "all"
else
+ data[:identifier] = identifier_type if identifier_type
data[:is_group_mention] = true
end
diff --git a/plugins/chat/spec/jobs/regular/chat_notify_mentioned_spec.rb b/plugins/chat/spec/jobs/regular/chat_notify_mentioned_spec.rb
index 3463d0a5068..b69e3cc4406 100644
--- a/plugins/chat/spec/jobs/regular/chat_notify_mentioned_spec.rb
+++ b/plugins/chat/spec/jobs/regular/chat_notify_mentioned_spec.rb
@@ -445,7 +445,7 @@ describe Jobs::ChatNotifyMentioned do
track_core_notification(message: message, to_notify_ids_map: to_notify_ids_map)
data_hash = created_notification.data_hash
- expect(data_hash[:identifier]).to be_nil
+ expect(data_hash[:identifier]).to eq(@chat_group.name)
expect(data_hash[:is_group_mention]).to eq(true)
end