diff --git a/packages/app/src/diagnostics/app-diagnostic-report.test.ts b/packages/app/src/diagnostics/app-diagnostic-report.test.ts index b23dda3ae1..b330d56745 100644 --- a/packages/app/src/diagnostics/app-diagnostic-report.test.ts +++ b/packages/app/src/diagnostics/app-diagnostic-report.test.ts @@ -123,6 +123,37 @@ describe("app diagnostics report", () => { expect(report).toContain("Last online: unknown"); }); + 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( diff --git a/packages/app/src/diagnostics/app-diagnostic-report.ts b/packages/app/src/diagnostics/app-diagnostic-report.ts index e47103a9b0..3ba48fc1f0 100644 --- a/packages/app/src/diagnostics/app-diagnostic-report.ts +++ b/packages/app/src/diagnostics/app-diagnostic-report.ts @@ -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"; }