Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(connect): local DNS failures no longer imply other devices cannot connect #27770

Closedvoltcrash(GitHub profile, opens in a new tab)wants to merge 2 commits intomain fromrefs/pull/27770/headopened View on GitHub

Showing 4 changed files with 42 additions and 13 deletions (loading 1).

x
0 of 4 viewed, 4 left
28 additions and 8 deletionsapps/server/src/cloud/ConnectReachability.test.tsModified
View file
@@ -19,7 +19,11 @@
​
import * as ServerSecretStore from "../auth/ServerSecretStore.ts";
import * as ConnectReachability from "./ConnectReachability.ts";
-import { classifyReachability, type ReachabilityFacts } from "./ConnectReachability.ts";
+import {
+ classifyReachability,
+ formatReachabilityFailure,
+ type ReachabilityFacts,
+} from "./ConnectReachability.ts";
import * as ManagedEndpointRuntime from "./ManagedEndpointRuntime.ts";
​
vi.mock("node:net", { spy: true });
@@ -50,9 +54,10 @@
[{ kind: "status", status: 530, cloudflareError: "1016" }, "unexpected_response"],
[{ kind: "network_error" }, "timeout"],
] as const)("maps endpoint result %o to %s", (endpoint, cause) => {
- expect(classifyReachability(facts({ endpoint, edgeReachable: true }), checkedAt)).toMatchObject(
- { status: "unreachable", cause },
- );
+ const result = classifyReachability(facts({ endpoint, edgeReachable: true }), checkedAt);
+ expect(result).toMatchObject({ status: "unreachable", cause });
+ if (result.status !== "unreachable") throw new Error("Expected an endpoint failure");
+ expect(formatReachabilityFailure(result)).toContain("NOT reachable from other devices");
});
​
it("keeps the endpoint cause when the TCP edge test cannot explain it", () => {
@@ -423,11 +428,12 @@