fix(server): html previews say how their browser exited #16872
Mergednkoynov(GitHub profile, opens in a new tab)merged 4 commits into
main fromrefs/pull/16872/headmerged by juliusmarminge View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:S
coderabbitai[bot](GitHub profile, opens in a new tab) approved these changes
juliusmarminge added labelsmacroscope-review
- apps/server/src/htmlRender/headlessChrome.ts line 359OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -334,5 +348,12 @@334348 // sandbox, says why on stderr, which may still be draining, so give it a moment.335349 const disconnect = Effect.gen(function* () {336350 yield* Fiber.await(stderrReader).pipe(Effect.timeout("1 second"), Effect.ignore);351+ const status = yield* child.exitCode.pipe(352+ Effect.map((code) => `exit code ${code}`),353+ Effect.catch((error) =>354+ Effect.succeed(`signal ${EXIT_SIGNAL.exec(String(error.cause))?.[1] ?? "unknown"}`),355+ ),356+ Effect.timeoutOption("1 second"),357+ );337358 const error = new HtmlRenderBrowserError({338- reason: "the browser exited unexpectedly",359+ reason: exitReason(Option.getOrUndefined(status), stderrTail),
coderabbitai[bot](GitHub profile, opens in a new tab) requested changes
apps/server/src/htmlRender/headlessChrome.ts line 351OutdatedResolvedby coderabbitai[bot](GitHub profile, opens in a new tab)@@ -334,3 +345,7 @@334345 // sandbox, says why on stderr, which may still be draining, so give it a moment.335346 const disconnect = Effect.gen(function* () {336347 yield* Fiber.await(stderrReader).pipe(Effect.timeout("1 second"), Effect.ignore);348+ const exit = yield* child.exitCode.pipe(349+ Effect.map((code): { exitCode?: number; signal?: string } => ({ exitCode: code })),350+ Effect.catch((error) =>351+ Effect.succeed({ signal: EXIT_SIGNAL.exec(String(error.cause))?.[1] ?? "unknown" }),coderabbitai[bot](GitHub profile, opens in a new tab) requested changes
apps/server/src/htmlRender/headlessChrome.ts line 352OutdatedResolvedby coderabbitai[bot](GitHub profile, opens in a new tab)@@ -334,3 +345,8 @@334345 // sandbox, says why on stderr, which may still be draining, so give it a moment.335346 const disconnect = Effect.gen(function* () {336347 yield* Fiber.await(stderrReader).pipe(Effect.timeout("1 second"), Effect.ignore);348+ const exit = yield* child.exitCode.pipe(349+ Effect.map((code): { exitCode?: number; signal?: string } => ({ exitCode: code })),350+ Effect.catch((error) => {351+ const signal = EXIT_SIGNAL.exec(String(error.cause))?.[1];352+ return Effect.succeed(signal === undefined ? {} : { signal });macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes
coderabbitai[bot](GitHub profile, opens in a new tab) approved these changes
juliusmarminge merged thisbd395e9
juliusmarminge closed this
Sign in to join this conversation.
macroscopeapp[bot](GitHub profile, opens in a new tab) reviewed