Skip to content
Source
Sign inSign up
pingdotgg/t3code

perf(desktop): reuse the prepared shell environment in the local backend #17384

MergedYash-Singh1(GitHub profile, opens in a new tab)merged 5 commits intomain fromrefs/pull/17384/headmerged by Yash-Singh1(GitHub profile, opens in a new tab) View on GitHub

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

x
0 of 12 viewed, 12 left
15 additions and 0 deletionsapps/desktop/src/backend/DesktopBackendConfiguration.test.tsModified
View file
@@ -325,6 +325,21 @@
}).pipe(Effect.scoped, Effect.provide(NodeServices.layer)),
​
+ it.effect("only the local primary bootstrap claims the prepared shell environment", () =>
+ withHarness(
+ Effect.gen(function* () {
+ const configuration = yield* DesktopBackendConfiguration.DesktopBackendConfiguration;
+​
+ const primary = yield* configuration.resolvePrimary;
+ const wsl = yield* configuration.resolveWsl({ port: 5000, distro: null });
+​
+ assert.equal(primary.bootstrap.shellEnvironmentPrepared, true);
+ // A WSL server runs on its own Linux user environment and must hydrate it.
+ assert.isUndefined(wsl.bootstrap.shellEnvironmentPrepared);
+ }),
+ ),
+ );
+​
it.effect("resolveWsl reuses the primary's bootstrap token", () =>
withHarness(
Effect.gen(function* () {
4 additions and 0 deletionsapps/desktop/src/backend/DesktopBackendConfiguration.tsModified
View file
@@ -567,6 +567,10 @@
host: backendExposure.bindHost,
desktopBootstrapToken: input.bootstrapToken,
desktopBootstrapSecret: input.bootstrapSecret,