Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): bound editor discovery during config loading #4291

Mergedmaria-rcksmerged 1 commit intomain fromrefs/pull/4291/headmerged by juliusmarminge View on GitHub

Showing 2 changed files with 30 additions and 1 deletion.

x
0 of 2 viewed, 2 left
18 additions and 0 deletionsapps/server/src/server.test.tsModified
View file
@@ -73,6 +73,7 @@
​
import * as ServerConfig from "./config.ts";
import { makeRoutesLayer } from "./server.ts";
+import { resolveAvailableEditorsForConfig } from "./ws.ts";
import * as CheckpointDiffQuery from "./checkpointing/CheckpointDiffQuery.ts";
import * as GitManager from "./git/GitManager.ts";
import * as Keybindings from "./keybindings.ts";
@@ -3728,6 +3729,23 @@
}).pipe(Effect.provide(NodeHttpServer.layerTest)),
+ it.effect("does not block server config when editor discovery never resolves", () =>
+ Effect.gen(function* () {
+ const discoveryInterrupted = yield* Deferred.make<void>();
+ const responseFiber = yield* resolveAvailableEditorsForConfig(
+ Effect.never.pipe(
+ Effect.onInterrupt(() => Deferred.succeed(discoveryInterrupted, undefined)),
+ ),
+ ).pipe(Effect.forkChild);
+​
+ yield* TestClock.adjust(Duration.seconds(5));
+​
+ const availableEditors = yield* Fiber.join(responseFiber);
+ yield* Deferred.await(discoveryInterrupted);
+ assert.deepEqual(availableEditors, []);
+ }),
+ );
Thread on line 3747

Timeout test missing yieldNow

Medium Severity

The new editor-discovery timeout test forks resolveAvailableEditorsForConfig over Effect.never, then calls TestClock.adjust without first yielding so the child fiber can register its timer. That diverges from the repo’s forkChild + TestClock.adjust pattern and can leave Fiber.join waiting forever, hanging CI.

Fix in Cursor Fix in Web
Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 4bd5bcfa380941c5a7102b169e6195e744c97bb3. Configure [here](https://www.cursor.com/dashboard/bugbot).