fix: Skip notifications for private notes (#13617)
When agents or integrations create private notes on a conversation, every note was sending a notification to the assigned agent and all conversation participants. The fix ensures that private notes no longer trigger new message notifications. If someone explicitly mentions a teammate in a private note, that person will still get notified as expected.
This commit is contained in:
@@ -2,11 +2,17 @@ require 'rails_helper'
|
||||
|
||||
describe Messages::NewMessageNotificationService do
|
||||
context 'when message is not notifiable' do
|
||||
it 'will not create any notifications' do
|
||||
it 'will not create any notifications for activity messages' do
|
||||
message = build(:message, message_type: :activity)
|
||||
expect(NotificationBuilder).not_to receive(:new)
|
||||
described_class.new(message: message).perform
|
||||
end
|
||||
|
||||
it 'will not create any notifications for private messages' do
|
||||
message = build(:message, message_type: :outgoing, private: true)
|
||||
expect(NotificationBuilder).not_to receive(:new)
|
||||
described_class.new(message: message).perform
|
||||
end
|
||||
end
|
||||
|
||||
context 'when message is notifiable' do
|
||||
|
||||
Reference in New Issue
Block a user