fix(HH-581): keep widget websocket on visitor auth (#152)
Co-authored-by: Rogee <rogee@ipao.vip>
This commit is contained in:
@@ -17,7 +17,7 @@ const WIDGET_PRESENCE_INTERVAL = 60000;
|
||||
|
||||
class ActionCableConnector extends BaseActionCableConnector {
|
||||
constructor(app, pubsubToken) {
|
||||
super(app, pubsubToken, '', WIDGET_PRESENCE_INTERVAL);
|
||||
super(app, pubsubToken, '', WIDGET_PRESENCE_INTERVAL, false);
|
||||
this.events = {
|
||||
'message.created': this.onMessageCreated,
|
||||
'message.updated': this.onMessageUpdated,
|
||||
|
||||
@@ -53,6 +53,10 @@ describe('Widget ActionCableConnector', () => {
|
||||
});
|
||||
};
|
||||
|
||||
it('uses visitor-token auth even when a dashboard session shares the origin', () => {
|
||||
expect(actionCable.useSessionAuth).toBe(false);
|
||||
});
|
||||
|
||||
it('emits message side effects only once when realtime replays a message', async () => {
|
||||
const message = {
|
||||
id: 42,
|
||||
|
||||
Reference in New Issue
Block a user