Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): preserve discovered editors when scanning times out #10694

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

Showing 4 changed files with 105 additions and 55 deletions (loading 1).

x
0 of 4 viewed, 4 left
64 additions and 2 deletionsapps/server/src/process/externalLauncher.test.tsModified
View file
@@ -754,8 +754,8 @@
​
// The handler probe carries its own timeout because the editor scan's outer
-// timeout in server.getConfig degrades to an EMPTY editor list: a wedged
-// xdg-mime must cost only the file manager, never the other editors. Runs on
+// timeout in server.getConfig returns editors found so far: a wedged xdg-mime
+// must cost only the file manager, never the other editors. Runs on
// the live clock so the probe's real timeout fires.
it.live.skipIf(windowsHost)("a stalled handler probe drops only the file manager", () =>
Effect.gen(function* () {
@@ -893,6 +893,68 @@
});
​
+it.effect("returns editors found before discovery times out", () => {
+ const fileInfo = { type: "File" } as FileSystem.File.Info;
+ let blockScan = true;
+ let statCalls = 0;
+ const launcherLayer = ExternalLauncher.layer.pipe(
+ Layer.provide(
+ Layer.mergeAll(
+ FileSystem.layerNoop({
+ stat: () =>
+ Effect.gen(function* () {
+ statCalls += 1;
+ if (blockScan && statCalls > 1) {
+ return yield* Effect.never;
+ }