fix(HH-581): keep widget websocket on visitor auth (#152)

Co-authored-by: Rogee <rogee@ipao.vip>
This commit is contained in:
Rogee
2026-08-24 10:54:38 +08:00
committed by GitHub
co-authored by rogee
parent c4ac664deb
commit 2c6bee2b37
5 changed files with 78 additions and 4 deletions
@@ -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,