From 6ab62cfd8de5f0b7ba0742ae4659973f71f55ae1 Mon Sep 17 00:00:00 2001 From: 4gray Date: Tue, 5 May 2026 10:41:59 +0200 Subject: [PATCH] fix(embedded-mpv): stop re-setting support inside startSession (infinite reload loop) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Regression introduced in the bundle 3 refactor. After calling prepareEmbeddedMpv, the controller wrote the response back into this.support — but the component's session-creation effect tracks this.support(), so updating it cleaned up the just-created session and ran startSession again, which prepared again, set support again, and so on. Net effect: endless "Loading stream…" spinner because every session was disposed before MPV could finish loading the file. The initial loadSupport() in the constructor already populates support (including capabilities). Drop the redundant set in startSession; leave a comment explaining why so it does not get re-added. Co-Authored-By: Claude Opus 4.7 (1M context) Entire-Checkpoint: f957cd9849e0 --- .../embedded-mpv-session-controller.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libs/ui/playback/src/lib/embedded-mpv-player/embedded-mpv-session-controller.ts b/libs/ui/playback/src/lib/embedded-mpv-player/embedded-mpv-session-controller.ts index 4bcb4b64a..9a9757099 100644 --- a/libs/ui/playback/src/lib/embedded-mpv-player/embedded-mpv-session-controller.ts +++ b/libs/ui/playback/src/lib/embedded-mpv-player/embedded-mpv-session-controller.ts @@ -142,9 +142,11 @@ export class EmbeddedMpvSessionController { 'Embedded MPV is not available in this environment.' ); } - if (prepared) { - this.support.set(prepared); - } + // Do not call this.support.set(prepared) here: support is already + // populated by loadSupport() in the constructor, and writing it + // again would re-trigger the component's session-creation effect + // (which depends on this.support()), tearing down the session we + // just created and looping forever. const created = await window.electron!.createEmbeddedMpvSession( measureBounds(host),