mirror of
https://github.com/getpaseo/paseo.git
synced 2026-11-08 01:14:52 +00:00
fix(app): identify routed connections in diagnostics
The runtime already identifies connections through another host as routed, but both diagnostic fields fell through to unknown. Preserve that distinction in the report.
This commit is contained in:
@@ -97,6 +97,37 @@ describe("app diagnostics report", () => {
|
||||
expect(report).not.toContain("tcp-password");
|
||||
});
|
||||
|
||||
test.each(["online", "error"] as const)(
|
||||
"identifies a routed connection while %s",
|
||||
(connectionStatus) => {
|
||||
const host = makeHost();
|
||||
host.connections.push({ id: "routed-origin", type: "routed", originServerId: "srv-origin" });
|
||||
const snapshot: HostRuntimeSnapshot = {
|
||||
serverId: host.serverId,
|
||||
activeConnectionId: "routed-origin",
|
||||
activeConnection: { type: "routed", endpoint: "srv-origin", display: "via srv-origin" },
|
||||
connectionStatus,
|
||||
client: null,
|
||||
lastError: connectionStatus === "error" ? "Host disconnected" : null,
|
||||
lastOnlineAt: null,
|
||||
agentDirectoryStatus: "ready",
|
||||
agentDirectoryError: null,
|
||||
hasEverLoadedAgentDirectory: true,
|
||||
probeByConnectionId: new Map(),
|
||||
clientGeneration: 1,
|
||||
connectionEpoch: 1,
|
||||
};
|
||||
|
||||
const report = formatHostRuntimeSection({ host, snapshot });
|
||||
|
||||
expect(report).toContain("Active connection: routed");
|
||||
expect(report).toContain("Connection 5: routed, active, probe=unknown");
|
||||
expect(report).toContain(`Status: ${connectionStatus}`);
|
||||
expect(report).toContain(`Last error: ${snapshot.lastError ?? "none"}`);
|
||||
expect(report).not.toContain("srv-origin");
|
||||
},
|
||||
);
|
||||
|
||||
test("redacts saved connection secrets from collected daemon and desktop text", () => {
|
||||
const host = makeHost();
|
||||
const redacted = redactAppDiagnosticReport(
|
||||
|
||||
@@ -100,6 +100,8 @@ export function describeConnectionKind(type: HostConnection["type"] | string): s
|
||||
return "local pipe";
|
||||
case "relay":
|
||||
return "relay";
|
||||
case "routed":
|
||||
return "routed";
|
||||
default:
|
||||
return "unknown";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user