Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server,desktop): browser tools report why a page failed to load #18588

Mergedrobertnisipeanu(GitHub profile, opens in a new tab)merged 9 commits intomain fromrefs/pull/18588/headmerged by juliusmarminge View on GitHub

Showing 8 changed files with 99 additions and 0 deletions (loading 6).

x
0 of 8 viewed, 8 left
7 additions and 0 deletionsapps/desktop/src/preview/DesktopBrowserHost.tsModified
View file
@@ -4,6 +4,7 @@
DesktopBrowserCommand,
DesktopBrowserEvent,
type DesktopBrowserEvent as DesktopBrowserEventType,
+ type PreviewAutomationLoadError,
} from "@t3tools/contracts";
import * as Context from "effect/Context";
import * as NodePath from "node:path";
@@ -93,6 +94,7 @@
readonly handleCommandLine: (line: string) => Effect.Effect<void>;
readonly attach: (key: DesktopBrowserTabKey, debuggee: DesktopBrowserTabDebugger) => void;
readonly detach: (key: DesktopBrowserTabKey) => void;
+ readonly loadFailed: (key: DesktopBrowserTabKey, failure: PreviewAutomationLoadError) => void;
readonly setShown: (key: DesktopBrowserTabKey, shown: boolean | undefined) => void;
readonly humanStartedDownload: (source: Electron.WebContents) => boolean;
readonly placeDownload: (source: Electron.WebContents, item: Electron.DownloadItem) => boolean;
@@ -523,6 +525,10 @@
if (tabs.get(id)?.stopWaiting === null) emit({ type: "shown", ...key, shown });
​
+ const loadFailed: DesktopBrowserHost["Service"]["loadFailed"] = (key, failure) => {
+ if (tabs.has(keyOf(key))) emit({ type: "loadFailed", ...key, ...failure });
Resolvedby coderabbitai[bot](GitHub profile, opens in a new tab)
+ };
+​
const handleCommandLine = (line: string) =>
Effect.sync(() => {
const command = decodeCommand(line);