[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 23dbc916e8)

Co-authored-by: Artur Wierzbicki <artur.wierzbicki@grafana.com>
This commit is contained in:
Grot (@grafanabot)
2023-01-13 12:34:16 -08:00
committed by GitHub
co-authored by Artur Wierzbicki
parent 90949a8db9
commit a88a55fc09
@@ -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);