From a88a55fc09764393b2b69d727ee76639327f0675 Mon Sep 17 00:00:00 2001 From: "Grot (@grafanabot)" <43478413+grafanabot@users.noreply.github.com> Date: Fri, 13 Jan 2023 21:34:16 +0100 Subject: [PATCH] [v9.2.x] Live: Fix `Subscription to the channel already exists` live streaming error (#61419) Live: Fix `Subscription to the channel already exists` live streaming error (#61406) #60570: Fix `subscription to the channel already exists` (cherry picked from commit 23dbc916e8a0ea72360fcda43fcccfc45f4dba80) Co-authored-by: Artur Wierzbicki --- 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);