Fix resource leaks when we stop using a connection

The execution of certain Observables related to a local or remote connection would continue even after we stopped caring about said connection because we were failing to give these state holders a proper ObservableScope of their own, separate from the CallViewModel's longer-lived scope. With this commit they now have scopes managed by generateKeyed$.
This commit is contained in:
Robin
2025-10-16 15:52:56 -04:00
parent 717c7420f9
commit d5efba285b
3 changed files with 66 additions and 70 deletions

View File

@@ -58,7 +58,7 @@ export class PublishConnection extends Connection {
trackerProcessorState$: Behavior<ProcessorState>,
) {
const { scope } = args;
logger.info("[LivekitRoom] Create LiveKit room");
logger.info("[PublishConnection] Create LiveKit room");
const { controlledAudioDevices } = getUrlParams();
const factory =