chore: Sentry Issue fixes (#4618)
Address the following sentry issues fixes: #4616, #4617
This commit is contained in:
@@ -32,6 +32,6 @@ class InboxMember < ApplicationRecord
|
|||||||
end
|
end
|
||||||
|
|
||||||
def remove_agent_from_round_robin
|
def remove_agent_from_round_robin
|
||||||
::RoundRobin::ManageService.new(inbox: inbox).remove_agent_from_queue(user_id)
|
::RoundRobin::ManageService.new(inbox: inbox).remove_agent_from_queue(user_id) if inbox.present?
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ class Integrations::Slack::IncomingMessageBuilder
|
|||||||
if message.present?
|
if message.present?
|
||||||
SUPPORTED_MESSAGE_TYPES.include?(message[:type])
|
SUPPORTED_MESSAGE_TYPES.include?(message[:type])
|
||||||
else
|
else
|
||||||
params[:event][:files].any?
|
params.dig(:event, :files).any?
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
20
spec/models/inbox_member_spec.rb
Normal file
20
spec/models/inbox_member_spec.rb
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
require 'rails_helper'
|
||||||
|
|
||||||
|
RSpec.describe InboxMember do
|
||||||
|
include ActiveJob::TestHelper
|
||||||
|
|
||||||
|
describe '#DestroyAssociationAsyncJob' do
|
||||||
|
let(:inbox_member) { create(:inbox_member) }
|
||||||
|
|
||||||
|
# ref: https://github.com/chatwoot/chatwoot/issues/4616
|
||||||
|
context 'when parent inbox is destroyed' do
|
||||||
|
it 'enques and processes DestroyAssociationAsyncJob' do
|
||||||
|
perform_enqueued_jobs do
|
||||||
|
inbox_member.inbox.destroy!
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
Reference in New Issue
Block a user