Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(client): stop blaming DNS when only the T3 Connect WebSocket fails #14531

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

Showing 5 changed files with 45 additions and 6 deletions (loading 2).

x
0 of 5 viewed, 5 left
29 additions and 1 deletionpackages/client-runtime/src/connection/supervisor.test.tsModified
View file
@@ -39,7 +39,7 @@
import * as EnvironmentSupervisor from "./supervisor.ts";
import * as ConnectionWakeups from "./wakeups.ts";
import { connectionRouteId, entryWithRoutes, isLearned, mergeLearnedRoutes } from "./routes.ts";
-import { NETWORK_BLOCKING_HINT } from "../errors/network.ts";
+import { NETWORK_BLOCKING_HINT, WEBSOCKET_BLOCKING_HINT } from "../errors/network.ts";
​
const TARGET = new PrimaryConnectionTarget({
environmentId: EnvironmentId.make("environment-1"),
@@ -549,6 +549,34 @@
}).pipe(Effect.provide(TestClock.layer())),
​
+ it.effect.each([
+ { label: "relay", entry: RELAY_ENTRY, relay: true },
+ { label: "relay fallback", entry: LAN_THEN_RELAY_ENTRY, relay: true },
+ { label: "direct with relay fallback", entry: LAN_THEN_RELAY_ENTRY, relay: false },
+ ])("uses the prepared route for a stalled $label connection", ({ entry, relay }) =>
+ Effect.gen(function* () {
+ const harness = yield* makeHarness({
+ prepare: (_, target) =>
+ relay && target._tag !== "RelayConnectionTarget"
+ ? Effect.fail(transient())
+ : Effect.succeed(preparedFor(target)),
+ ready: () => Effect.never,
+ });
+ const supervisor = yield* EnvironmentSupervisor.make(entry, {
+ initiallyDesired: true,
+ }).pipe(Effect.provide(harness.dependencies));