Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix: prevent reconnect loops during server stalls #5561

Mergedgfsaaser24(GitHub profile, opens in a new tab)merged 9 commits intomain fromrefs/pull/5561/headmerged by t3dotgg(GitHub profile, opens in a new tab) View on GitHub

Showing 13 changed files with 83 additions and 2 deletions (loading 9).

x
0 of 13 viewed, 13 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())),