Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): a stuck browser action no longer wedges its tab or other tabs #32866

Openjuliusmarmingewants to merge 14 commits intomain fromfix/issue-32849opened View on GitHub

Showing 9 changed files with 234 additions and 0 deletions (loading 8).

x
0 of 9 viewed, 9 left
234 additions and 0 deletionsapps/server/src/preview/ServerBrowser.test.tsModified
View file
@@ -2525,3 +2525,237 @@
).pipe(Effect.provide(layer)),
+​
+/** Makes the tab's next color scheme change hang in Playwright; resolves once it has started. */
+const stallColorScheme = (page: ReturnType<typeof makeContext>["page"]) => {
+ const started = Promise.withResolvers<void>();
+ page.emulateMedia.mockImplementationOnce(() => {
+ started.resolve();
+ return new Promise<void>(() => {});
+ });
+ return Effect.promise(() => started.promise);
+};
+​
+it.effect("a stuck agent action times out on the server and later calls on its tab fail fast", () =>
+ Effect.scoped(
+ Effect.gen(function* () {
+ const { broker, tabId } = yield* ready;
+ const stalled = stallColorScheme(contexts[0]!.page);
+ const stuck = yield* broker
+ .invoke<void>({
+ scope,
+ tabId,
+ operation: "setColorScheme",
+ input: { colorScheme: "dark" },
+ timeoutMs: 1_000,
+ })
+ .pipe(Effect.flip, Effect.forkScoped);
+ yield* stalled;