chore: Fix conversation status in webhooks (#3364)

- fix the wrong conversation status being sent in webhooks
- additional information in websocket events
- refactor activity messaging code
- move activity message generation to background job to stop the callback loop
This commit is contained in:
Sojan Jose 2021-11-12 16:17:59 +05:30 committed by GitHub
parent b119d9e729
commit d78cb67a2a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 219 additions and 136 deletions

View file

@ -64,7 +64,10 @@ RSpec.describe 'Conversation Assignment API', type: :request do
expect(response).to have_http_status(:success)
expect(conversation.reload.assignee).to eq(nil)
expect(conversation.messages.last.content).to eq("Conversation unassigned by #{agent.name}")
expect(Conversations::ActivityMessageJob)
.to(have_been_enqueued.at_least(:once)
.with(conversation, { account_id: conversation.account_id, inbox_id: conversation.inbox_id, message_type: :activity,
content: "Conversation unassigned by #{agent.name}" }))
end
end