Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): Antigravity sessions no longer fail when the browser preflight is slow #22804

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

Showing 2 changed files with 99 additions and 1 deletion.

x
0 of 2 viewed, 2 left
89 additions and 0 deletionsapps/server/src/provider/antigravityAuthSupport.test.tsModified
View file
@@ -10,8 +10,13 @@
import * as Path from "effect/Path";
import * as Result from "effect/Result";
import * as Schema from "effect/Schema";
+import * as Sink from "effect/Sink";
import * as Stream from "effect/Stream";
+import * as Deferred from "effect/Deferred";
+import * as Fiber from "effect/Fiber";
import * as Ndjson from "effect/encoding/Ndjson";
+import * as ChildProcessSpawner from "effect/process/ChildProcessSpawner";
+import * as TestClock from "effect/testing/TestClock";
import * as AcpErrors from "effect-acp/errors";
import { symlinksSupported } from "@t3tools/shared/testing/symlinks";
​
@@ -639,6 +644,90 @@
}),
​
+ // Stands in for the helper process: it prints the expected marker, then exits after
+ // `exitDelay`. `started` completes once the exit wait begins, so the TestClock is only
+ // advanced after the preflight timer and the delay are both registered.
+ const preflightHelper = (exitDelay: Effect.Effect<void>) => {
+ const spawns = { count: 0 };
+ const started = Deferred.makeUnsafe<void>();
+ const spawner = ChildProcessSpawner.make(() =>
+ Effect.sync(() => {
+ spawns.count += 1;
+ return ChildProcessSpawner.makeHandle({
+ pid: ChildProcessSpawner.ProcessId(1),