chore: Migrate PubSub Token to contact inbox (#3434)
At present, the websocket pubsub tokens are present at the contact objects in chatwoot. A better approach would be to have these tokens at the contact_inbox object instead. This helps chatwoot to deliver the websocket events targetted to the specific widget connection, stop contact events from leaking into other chat sessions from the same contact. Fixes #1682 Fixes #1664 Co-authored-by: Pranav Raj S <pranav@chatwoot.com> Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
This commit is contained in:
@@ -11,20 +11,4 @@ RSpec.describe Contact do
|
||||
it { is_expected.to belong_to(:account) }
|
||||
it { is_expected.to have_many(:conversations).dependent(:destroy) }
|
||||
end
|
||||
|
||||
describe 'pubsub_token' do
|
||||
let(:user) { create(:user) }
|
||||
|
||||
it 'gets created on object create' do
|
||||
obj = user
|
||||
expect(obj.pubsub_token).not_to eq(nil)
|
||||
end
|
||||
|
||||
it 'does not get updated on object update' do
|
||||
obj = user
|
||||
old_token = obj.pubsub_token
|
||||
obj.update(name: 'test')
|
||||
expect(obj.pubsub_token).to eq(old_token)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user