Live: Fix Subscription to the channel already exists live streaming error (#61406)

#60570: Fix `subscription to the channel already exists`
This commit is contained in:
Artur Wierzbicki
2023-01-13 00:55:01 +07:00
committed by GitHub
parent 6b620c79e0
commit 23dbc916e8

View File

@@ -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);