From 23dbc916e8a0ea72360fcda43fcccfc45f4dba80 Mon Sep 17 00:00:00 2001 From: Artur Wierzbicki Date: Fri, 13 Jan 2023 00:55:01 +0700 Subject: [PATCH] Live: Fix `Subscription to the channel already exists` live streaming error (#61406) #60570: Fix `subscription to the channel already exists` --- public/app/features/live/centrifuge/service.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/public/app/features/live/centrifuge/service.ts b/public/app/features/live/centrifuge/service.ts index 044db5eff2d..41042f10e8b 100644 --- a/public/app/features/live/centrifuge/service.ts +++ b/public/app/features/live/centrifuge/service.ts @@ -133,7 +133,10 @@ export class CentrifugeService implements CentrifugeSrv { return channel; } channel.shutdownCallback = () => { - this.open.delete(id); // remove it from the list of open channels + this.open.delete(id); + + // without a call to `removeSubscription`, the subscription will remain in centrifuge's internal registry + this.centrifuge.removeSubscription(this.centrifuge.getSubscription(id)); }; this.open.set(id, channel);