Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): report the actual preview snapshot timeout #24130

MergedWosca(GitHub profile, opens in a new tab)merged 8 commits intomain fromrefs/pull/24130/headmerged by juliusmarminge View on GitHub

Showing 5 changed files with 184 additions and 0 deletions (loading 2).

x
0 of 5 viewed, 5 left
37 additions and 0 deletionsapps/server/src/mcp/PreviewAutomationBroker.test.tsModified
View file
@@ -392,6 +392,43 @@
}),
​
+it.effect("reports the capture deadline and pending stage instead of the request timeout", () =>
+ Effect.scoped(
+ Effect.gen(function* () {
+ const broker = yield* makeBroker;
+ const connected = yield* Deferred.make<void>();
+ const requests = requestsFrom(
+ (yield* broker.connect(makeHost())).pipe(
+ Stream.tap((event) =>
+ event.type === "connected" ? Deferred.succeed(connected, undefined) : Effect.void,
+ ),
+ ),
+ );
+ yield* Stream.runForEach(requests, (request) =>
+ broker.respond({
+ clientId: "client-1",
+ connectionId: request.connectionId,
+ requestId: request.requestId,
+ ok: false,
+ error: {
+ _tag: "PreviewAutomationTimeoutError",
+ message: "Snapshot capture did not complete.",
+ detail: { timeoutMs: 10_000, pendingStages: ["screenshot"] },
+ },
+ }),
+ ).pipe(Effect.forkScoped);
+ yield* Deferred.await(connected);