Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(desktop): avoid blocking IPC during topology polling #12698

Closedhnasser22(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/12698/headopened View on GitHub

Showing 13 changed files with 9 additions and 12 deletions (loading 10).

x
0 of 13 viewed, 13 left
4 additions and 8 deletionsapps/desktop/src/backend/DesktopBackendConfiguration.test.tsModified
View file
@@ -1418,14 +1418,10 @@
it("resolvePrimaryLabel is runSync-safe against the real WSL availability probe", async () => {
- // getLocalEnvironmentBootstraps is a sync IPC method: it resolves the
- // primary instance's lazy label through Effect.runSync. The label chains
- // to wslEnvironment.isAvailable, whose real layer probes the filesystem.
- // That probe must run once at layer build and expose a resolved value, not
- // a live async effect — otherwise runSync throws in the handler. Build the
- // real WSL layer (not the sync test stub) and resolve the label with a
- // top-level runSync, exactly as the handler does.
- // oxlint-disable-next-line t3code/no-manual-effect-runtime-in-tests -- This test intentionally replicates the sync IPC handler's runSync path to catch a regression to async-only resolution; it.effect would mask it.
+ // The label chains to wslEnvironment.isAvailable. Using the real WSL layer
+ // and runSync verifies that repeated topology reads use the cached result
+ // instead of starting a filesystem probe each time.
+ // oxlint-disable-next-line t3code/no-manual-effect-runtime-in-tests -- runSync detects a regression from the cached WSL availability value to a live async probe; it.effect would mask it.
const runtime = ManagedRuntime.make(
DesktopBackendConfiguration.layer.pipe(
Layer.provideMerge(serverExposureLayer),
2 additions and 2 deletionsapps/desktop/src/ipc/methods/localEnvironment.test.tsModified
View file
@@ -46,12 +46,12 @@
);
return Effect.gen(function* () {
yield* setLocalEnvironmentEnabled.handler(false);
- assert.isFalse(yield* getLocalEnvironmentEnabled.handler());
+ assert.isFalse(yield* getLocalEnvironmentEnabled.handler(undefined));
yield* setLocalEnvironmentEnabled.handler(false);