Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(preview): Return Request Timeouts Without Disconnecting Other Agents #23564

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

Showing 2 changed files with 144 additions and 0 deletions.

x
0 of 2 viewed, 2 left
133 additions and 0 deletionsapps/server/src/preview/ServerBrowser.test.tsModified
View file
@@ -24,6 +24,7 @@
import * as PubSub from "effect/PubSub";
import * as Queue from "effect/Queue";
import * as Stream from "effect/Stream";
+import * as TestClock from "effect/testing/TestClock";
import type { BrowserContext, Page } from "playwright-core";
import { beforeEach, expect, vi } from "vite-plus/test";
​
@@ -437,6 +438,138 @@
).pipe(Effect.provide(layer)),
​
+it.effect("a stalled tab request times out without disconnecting another agent", () =>
+ Effect.scoped(
+ Effect.gen(function* () {
+ const { broker, tabId } = yield* ready;
+ const otherScope = asSession("agent-b");
+ const other = yield* broker.invoke<PreviewAutomationStatus>({
+ scope: otherScope,
+ operation: "open",
+ input: { reuseExistingTab: false, show: false, url: "https://example.com/peer" },
+ });
+ const started = Promise.withResolvers<void>();
+ const finish = Promise.withResolvers<void>();
+ const page = contexts[0]!.page;
+ page.goto.mockImplementationOnce(() => {
+ started.resolve();
+ return finish.promise;
+ });