Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix: connection-resilience RFC follow-ups (#5561 + review fixes) #5564

Closedt3dotgg(GitHub profile, opens in a new tab)wants to merge 5 commits intomain fromrefs/pull/5564/headopened View on GitHub

Showing 15 changed files with 79 additions and 5 deletions (loading 11).

x
0 of 15 viewed, 15 left
61 additions and 0 deletionsapps/server/src/process/externalLauncher.test.tsModified
View file
@@ -7,6 +7,7 @@
import * as Path from "effect/Path";
import * as Sink from "effect/Sink";
import * as Stream from "effect/Stream";
+import * as TestClock from "effect/testing/TestClock";
import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process";
​
import { HostProcessPlatform } from "@t3tools/shared/hostProcess";
@@ -155,6 +156,66 @@
}).pipe(Effect.scoped, Effect.provide(NodeServices.layer)),
​
+it.effect("memoizes editor discovery and refreshes after the cache window", () => {
+ let statCalls = 0;
+ const fileInfo = { type: "File" } as FileSystem.File.Info;
+ const launcherLayer = ExternalLauncher.layer.pipe(
+ Layer.provide(
+ Layer.mergeAll(
+ FileSystem.layerNoop({
+ stat: () =>
+ Effect.sync(() => {
+ statCalls += 1;
+ return fileInfo;
+ }),
+ }),
+ Path.layer,
+ Layer.succeed(
+ ChildProcessSpawner.ChildProcessSpawner,
+ ChildProcessSpawner.make(() => Effect.sync(() => makeMockDetachedHandle())),