From d8eb5d2f6f5d24f8e847d178da28261481a51386 Mon Sep 17 00:00:00 2001 From: EtienneLescot Date: Fri, 19 Jun 2026 12:16:38 +0200 Subject: [PATCH 1/3] Make Discord sync optional --- .github/workflows/discord.yaml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/discord.yaml b/.github/workflows/discord.yaml index 6da25d0d6..b8bcc1d24 100644 --- a/.github/workflows/discord.yaml +++ b/.github/workflows/discord.yaml @@ -210,15 +210,10 @@ jobs: } if (!webhookUrl) { - const strictEvents = new Set(["pull_request_target", "workflow_dispatch"]); const msg = `Discord sync skipped: webhook secret unavailable for event '${context.eventName}'. ` + "Set either DISCORD_WEBHOOK_URL or DISCORD_PR_FORUM_WEBHOOK in repository secrets."; - if (strictEvents.has(context.eventName)) { - core.setFailed(msg); - } else { - core.warning(msg); - } + core.warning(msg); return; } From eb80a730ccecbbd3eb8b2c7a9624fd77d2fe4f48 Mon Sep 17 00:00:00 2001 From: EtienneLescot Date: Fri, 19 Jun 2026 12:37:54 +0200 Subject: [PATCH 2/3] Address source selector review feedback --- src/components/launch/LaunchWindow.test.tsx | 40 +++++++++++++++++++++ src/components/launch/LaunchWindow.tsx | 20 ++++++++--- 2 files changed, 55 insertions(+), 5 deletions(-) diff --git a/src/components/launch/LaunchWindow.test.tsx b/src/components/launch/LaunchWindow.test.tsx index 2bf9c2dbe..c12c04921 100644 --- a/src/components/launch/LaunchWindow.test.tsx +++ b/src/components/launch/LaunchWindow.test.tsx @@ -268,6 +268,46 @@ describe("LaunchWindow record button", () => { expect(recorderState.value.toggleRecording).not.toHaveBeenCalled(); }); + it("clears record-after-selection intent when opening the source picker fails", async () => { + window.electronAPI.openSourceSelector = vi.fn(async () => { + throw new Error("source selector failed"); + }); + + renderLaunchWindow(); + await waitForSourceSelectionSubscription(); + + fireEvent.click(await screen.findByTestId("launch-record-button")); + + await waitFor(() => { + expect(window.electronAPI.openSourceSelector).toHaveBeenCalledTimes(1); + }); + + emitSelectedSourceChanged(displayOneSource); + + await waitFor(() => { + expect(screen.getByTestId("launch-record-button")).toHaveAttribute("title", "Display 1"); + }); + expect(recorderState.value.toggleRecording).not.toHaveBeenCalled(); + }); + + it("handles selected source polling failures", async () => { + const error = new Error("selected source unavailable"); + const warnSpy = vi.spyOn(console, "warn").mockImplementation(() => undefined); + stubElectronAPI( + vi.fn(async () => { + throw error; + }), + ); + + renderLaunchWindow(); + + await waitFor(() => { + expect(warnSpy).toHaveBeenCalledWith("Failed to refresh selected source:", error); + }); + + warnSpy.mockRestore(); + }); + it("starts recording when a source is already selected", async () => { stubElectronAPI(vi.fn(async () => displayOneSource)); diff --git a/src/components/launch/LaunchWindow.tsx b/src/components/launch/LaunchWindow.tsx index 373aeac55..f149b989f 100644 --- a/src/components/launch/LaunchWindow.tsx +++ b/src/components/launch/LaunchWindow.tsx @@ -442,9 +442,15 @@ export function LaunchWindow() { useEffect(() => { const checkSelectedSource = async () => { - if (window.electronAPI) { + if (!window.electronAPI) { + return; + } + + try { const source = await window.electronAPI.getSelectedSource(); applySelectedSource(source); + } catch (error) { + console.warn("Failed to refresh selected source:", error); } }; @@ -488,11 +494,15 @@ export function LaunchWindow() { const handleRecordButtonClick = () => { if (!hasSelectedSource && !recording) { recordAfterSourceSelectionRef.current = true; - void openSourceSelector().then((result) => { - if (!result.opened) { + void openSourceSelector() + .then((result) => { + if (!result.opened) { + recordAfterSourceSelectionRef.current = false; + } + }) + .catch(() => { recordAfterSourceSelectionRef.current = false; - } - }); + }); return; } From 45f8c5056ebf25fdbba42395ef767fbf18cc5f3b Mon Sep 17 00:00:00 2001 From: EtienneLescot Date: Fri, 19 Jun 2026 15:41:27 +0200 Subject: [PATCH 3/3] Harden source selector rejection test --- src/components/launch/LaunchWindow.test.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/launch/LaunchWindow.test.tsx b/src/components/launch/LaunchWindow.test.tsx index c12c04921..6440f1d41 100644 --- a/src/components/launch/LaunchWindow.test.tsx +++ b/src/components/launch/LaunchWindow.test.tsx @@ -282,6 +282,10 @@ describe("LaunchWindow record button", () => { expect(window.electronAPI.openSourceSelector).toHaveBeenCalledTimes(1); }); + await act(async () => { + await Promise.resolve(); + }); + emitSelectedSourceChanged(displayOneSource); await waitFor(() => {