mirror of
https://github.com/vector-im/element-call.git
synced 2026-06-30 18:02:56 +00:00
Merge pull request #4040 from element-hq/scope-leak-lint
Add lint rule to prevent ObservableScope resource leaks
This commit is contained in:
@@ -161,6 +161,10 @@ export function createCallNotificationLifecycle$({
|
||||
recipient,
|
||||
outcome$: race(timeout$, accept$, decline$).pipe(
|
||||
take(1),
|
||||
// Make this observable 'hot' to avoid running multiple timers. This
|
||||
// is not actually a resource leak since there will be at most one
|
||||
// active ring attempt at any given time.
|
||||
// eslint-disable-next-line element-call/no-observablescope-leak
|
||||
scope.share,
|
||||
),
|
||||
});
|
||||
|
||||
@@ -92,6 +92,7 @@ export function createMemberMedia(
|
||||
}: MemberMediaInputs,
|
||||
): BaseMemberMediaViewModel {
|
||||
const trackBehavior$ = (
|
||||
scope: ObservableScope,
|
||||
source: Track.Source,
|
||||
): Behavior<TrackReference | undefined> =>
|
||||
scope.behavior(
|
||||
@@ -102,8 +103,8 @@ export function createMemberMedia(
|
||||
),
|
||||
);
|
||||
|
||||
const audio$ = trackBehavior$(audioSource);
|
||||
const video$ = trackBehavior$(videoSource);
|
||||
const audio$ = trackBehavior$(scope, audioSource);
|
||||
const video$ = trackBehavior$(scope, videoSource);
|
||||
|
||||
return {
|
||||
...createBaseMedia(inputs),
|
||||
|
||||
Reference in New Issue
Block a user