Skip to content
Source
Sign inSign up
pingdotgg/t3code

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

Closedrobertnisipeanu(GitHub profile, opens in a new tab)wants to merge 3 commits intomain fromrefs/pull/16835/headopened View on GitHub

Showing 11 changed files with 121 additions and 0 deletions (loading 8).

x
0 of 11 viewed, 11 left
17 additions and 0 deletionsapps/desktop/src/preview/DesktopBrowserHost.test.tsModified
View file
@@ -64,6 +64,23 @@
}),
);
​
+ it.effect("reports load failures only for attached tabs", () =>
+ Effect.gen(function* () {
+ const host = yield* DesktopBrowserHost.make;
+ const failure = { url: "https://device.local/", code: -202, description: "ERR_CERT" };
+ const reader = yield* takeEvents(host, 2).pipe(Effect.forkScoped);
+ // Wait until the reader is subscribed, so an event for the unattached tab would reach it.
+ yield* Effect.yieldNow;
+ host.loadFailed(key, failure);
+ host.attach(key, makeDebuggee().tab);
+ host.loadFailed(key, failure);
+ expect(yield* Fiber.join(reader)).toEqual([
+ { type: "attached", ...key },
+ { type: "loadFailed", ...key, ...failure },
+ ]);
+ }).pipe(Effect.scoped),
+ );
+​
it.effect("drops replies from a relay the server released", () =>
Effect.gen(function* () {
const host = yield* DesktopBrowserHost.make;
10 additions and 0 deletionsapps/desktop/src/preview/DesktopBrowserHost.tsModified
View file
@@ -79,6 +79,11 @@
readonly attach: (key: DesktopBrowserTabKey, debuggee: DesktopBrowserTabDebugger) => void;