Skip to content

Commit d16b847

Browse files
committed
fix(preview): guide recovery after opening a tab times out
1 parent b4c52d3 commit d16b847

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

‎apps/server/src/preview/ServerBrowser.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ it.live("preview_open reports its navigation timeout instead of the request budg
502502
timeoutMs: 15_000,
503503
});
504504
expect(error.message).toBe(
505-
"Preview automation open exceeded the browser's operation deadline. The browser responded; check preview_status on the same tab before retrying.",
505+
"Preview automation open exceeded the browser's operation deadline. The browser responded; inspect preview_status.tabs for a newly created tab and use its tabId before retrying.",
506506
);
507507
}),
508508
).pipe(Effect.provide(layer)),

‎packages/contracts/src/previewAutomation.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -770,7 +770,9 @@ export class PreviewAutomationTimeoutError extends Schema.TaggedError<PreviewAut
770770
) {
771771
override get message(): string {
772772
if (this.remoteTag === "PreviewAutomationTimeoutError") {
773-
return `Preview automation ${this.operation} exceeded the browser's operation deadline. The browser responded; check preview_status on the same tab before retrying.`;
773+
return this.operation === "open"
774+
? "Preview automation open exceeded the browser's operation deadline. The browser responded; inspect preview_status.tabs for a newly created tab and use its tabId before retrying."
775+
: `Preview automation ${this.operation} exceeded the browser's operation deadline. The browser responded; check preview_status on the same tab before retrying.`;
774776
}
775777
const summary = `Preview automation ${this.operation} timed out after ${this.timeoutMs}ms.`;
776778
return summary;

0 commit comments

Comments
 (0)