onWelcome subscribes with `immediate: true`, so the listener fires
synchronously with whatever welcome payload is already in the atom. The
previous code compared against `previousPrimaryEnvId` (descriptor-derived);
if the descriptor hadn't loaded yet, that was null and any non-null current
welcome would resolve the promise instantly, completing the "syncing" stage
before the new backend's welcome actually arrived. Capture the current
welcome's env-id from the atom as the baseline instead so the immediate
fire never matches the "new welcome arrived" predicate.
- remove the unused `enabled` field from WslConfig and the unreferenced
DEFAULT_WSL_CONFIG export; the toggle moved to DesktopAppSettings.wslMode
during the migration and the field was carried along by every caller as
noise that didn't influence behavior
- wrap the entire backend-swap flow (success + catch) in suppressReconnect
so the catch-block reauth doesn't fire reconnect/offline toasts on top of
the error toast the user is reading. The previous structure only
suppressed during the happy path; recovery work landed outside the window
The renderer's 180s ceiling was shorter than the IPC's worst-case duration:
setWslBackend can take up to ~2min for the initial readiness wait plus
another ~2min for the rollback readiness wait before throwing
WslBackendSwapError, so the client was firing "Backend swap took too long"
while the main process was still actively rolling back. Bump the ceiling
to 6 minutes (4min IPC worst case + ~60s reauth retry budget + 45s welcome
race) so a real hang still surfaces but a legitimate rollback completes.
The dropdown maps state.distro: null to the actual default distro's name
so the Select highlights a real option, but the no-op check still compared
target.distro (e.g. "Ubuntu") against state.distro (null). Re-picking the
visually-active row opened the confirmation dialog and triggered a full
backend restart for what was clearly a no-op. Resolve both sides through
the same null->default mapping before comparing.
- swap "__local__" / "__default__" select values for "backend:local" /
"backend:default-wsl" — the colon is rejected by DISTRO_NAME_PATTERN so
the sentinels can never collide with an actual WSL distro name
- remove VITE_DEV_SERVER_URL from WSL_FORWARDED_ENV_NAMES; the value is
delivered exclusively via the --dev-url CLI flag because WSLENV translation
of URL-shaped values is unreliable, and keeping it in both paths
contradicted the comment at the CLI-flag site
- map null distro to the actual default distro name in the backend select
so the dropdown highlights a real option instead of an orphan "__default__"
with no matching item when distros are listed
- add getUserHome to DesktopWslEnvironment (cached per distro) and pass the
resolved /home/<user> into the picker helper so ~/path expands correctly
instead of producing /home/<rest>
- surface a clearer error when the rollback backend also fails to start, so
the user knows the app is degraded rather than seeing the misleading
"Rolled back to the previous mode" message
- move clearTimeout(flowTimeoutHandle) into the finally block so it fires
on success, error, and timeout — previously the error path left a live
180s timer that would reject an unreferenced promise (unhandled rejection)
- remove the second removeEnvironmentState call after welcome; the first
call right after the IPC swap already wipes the old environment state
and nothing recreates state under the old env id during reauth/welcome
- drain stdout/stderr concurrently in runWslShell so node-gyp output
on both pipes can't deadlock the child
- short-circuit waitForReady when desiredRunning flips off, so an
external stop() during swap doesn't waste the full timeout
- guard runSwap continuations after the 180s flow timeout so an
orphaned IPC resolution can't overwrite rolled-back UI state
- drop unused refreshPrimaryEnvironmentDescriptor — descriptor URL is
stable across the swap and consumers re-fetch lazily
Lets the desktop app launch the local backend inside a WSL distro
instead of natively on Windows. Adds:
- Backend plumbing (apps/desktop/src/wsl): pure path parsing
utilities, a DesktopWslEnvironment Effect service wrapping
wsl.exe operations (listDistros, preWarm, windowsToWslPath,
ensureNodePty, isAvailable), and an explicit preflight that
checks for missing node / build tools before spawning so the
failure message names the actual problem.
- Spawn path: DesktopBackendConfiguration branches on the new
wslMode setting and assembles "wsl.exe -d <distro> -- node
<linux-entry> --bootstrap-fd 0" with the bootstrap envelope on
stdin (wsl.exe drops additional file descriptors). Sensitive env
vars forward via WSLENV; --dev-url is passed as a CLI flag so the
WSL dev backend lands in dev/ instead of userdata/ deterministi-
cally. The Windows-side T3CODE_HOME is scrubbed and extendEnv is
disabled for WSL so the WSL backend cannot accidentally share a
baseDir with the local backend via /mnt/c/...
- Settings: wslMode + wslDistro on DesktopAppSettings, with
validation that drops distro names containing control or shell
meta characters. Contracts get DesktopWslMode / DesktopWslDistro
/ DesktopWslState schemas.
- IPC: getWslState and setWslBackend on the desktop bridge. The
setter pre-warms the WSL VM, persists settings, then drives an
in-process backend stop + start with a 2-minute readiness wait
and a rollback path that reverts to the previous mode if the new
backend never reports ready. pickFolder defaults to the WSL home
UNC path when wslMode is "wsl".
- Web UI: backend-runtime selector in Connection Settings with a
three-stage swap modal (restarting / re-establishing session /
syncing) that suppresses the WS reconnect toast for the duration
of the swap, waits for the new backend's welcome event before
closing, and clears the previous env's store state so the side-
bar does not render stale threads. New suppressReconnect helper
on the connection-status atom plus exports for the descriptor
refresh and reauth used by the swap flow.
Stdin pipes inherited across the wsl.exe boundary fail to re-open
via /proc/self/fd/0, so add EACCES to the codes that drop back to
reading the fd directly. Without this the WSL desktop backend
fails to load its bootstrap envelope with "Failed to duplicate
bootstrap fd" and ends up in a scheduled-restart loop.
- Restrict release workflow defaults to read-only access
- Grant `id-token` only to the publish job
- Document safe handling for `pull_request_target` in PR size checks