From bd82399cca4f633d6e3bb1e0d471d9f36c68fca2 Mon Sep 17 00:00:00 2001 From: Josh Gratton Date: Fri, 5 Jun 2026 14:00:27 -0400 Subject: [PATCH] refactor(desktop): use Effect.orElseSucceed for WSL probe fallbacks Align the four list/path/IP/home probe fallbacks with the convention upstream adopted in #2968: replace Effect.catch(() => Effect.succeed(x)) with the more direct Effect.orElseSucceed(() => x). Behavior is identical (recover from the error channel with a default); silences the new catchToOrElseSucceed lint. --- apps/desktop/src/wsl/DesktopWslEnvironment.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/desktop/src/wsl/DesktopWslEnvironment.ts b/apps/desktop/src/wsl/DesktopWslEnvironment.ts index c2e10901f0..e41eaea588 100644 --- a/apps/desktop/src/wsl/DesktopWslEnvironment.ts +++ b/apps/desktop/src/wsl/DesktopWslEnvironment.ts @@ -327,7 +327,7 @@ const listDistrosImpl: Effect.Effect< ).pipe( Effect.timeoutOption(LIST_TIMEOUT), Effect.map(Option.getOrElse((): readonly WslDistro[] => [])), - Effect.catch(() => Effect.succeed([])), + Effect.orElseSucceed((): readonly WslDistro[] => []), ); const preWarmImpl = ( @@ -382,7 +382,7 @@ const windowsToWslPathImpl = ( ).pipe( Effect.timeoutOption(WSLPATH_TIMEOUT), Effect.map(Option.flatten), - Effect.catch(() => Effect.succeed(Option.none())), + Effect.orElseSucceed(() => Option.none()), ); }; @@ -420,7 +420,7 @@ const getDistroIpImpl = ( ).pipe( Effect.timeoutOption(USER_HOME_TIMEOUT), Effect.map(Option.flatten), - Effect.catch(() => Effect.succeed(Option.none())), + Effect.orElseSucceed(() => Option.none()), ); const getUserHomeImpl = ( @@ -458,7 +458,7 @@ const getUserHomeImpl = ( ).pipe( Effect.timeoutOption(USER_HOME_TIMEOUT), Effect.map(Option.flatten), - Effect.catch(() => Effect.succeed(Option.none())), + Effect.orElseSucceed(() => Option.none()), ); const makeIsAvailable = (