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:
Muhsin Keloth
2026-02-23 15:40:54 +04:00
committed by GitHub
parent 40da358dc2
commit b220663785
3 changed files with 27 additions and 5 deletions

View File

@@ -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