Skip to content

Commit 03b7a66

Browse files
coopernetesclaude
andcommitted
fix: handle absent tls/http fields in connectivity response (NON_NULL Jackson)
SpringWebConfig configures Jackson with NON_NULL inclusion, so null values are omitted from the JSON response. ConnectivityController sets tls=null for HTTP providers and when TCP fails, but those null values are stripped before reaching the browser. The frontend received tls=undefined, and the strict null check (=== null) fell through to tls.status, crashing with TypeError. - ProviderConnectivity: mark tls and http as optional (| undefined) in api.ts - ConnectivityRow: use == null (covers both null and undefined) for tlsOk - TlsBadge / HttpBadge: accept undefined in prop type, use == null guard Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent a34c56f commit 03b7a66

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

git-proxy-java-dashboard/frontend/src/api.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,8 +330,8 @@ export interface LogStep {
330330
export interface ProviderConnectivity {
331331
uri: string
332332
tcp: TcpResult
333-
tls: TlsResult | null
334-
http: HttpResult | null
333+
tls?: TlsResult | null
334+
http?: HttpResult | null
335335
/** Only present on targeted checks (provider + repoPath supplied) */
336336
gitProbe?: GitProbe | null
337337
/** Structured step log — only present on targeted checks */

git-proxy-java-dashboard/frontend/src/pages/Admin.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ function TcpBadge({ tcp }: { tcp: TcpResult }) {
3030
)
3131
}
3232

33-
function TlsBadge({ tls }: { tls: TlsResult | null }) {
34-
if (tls === null) return null
33+
function TlsBadge({ tls }: { tls: TlsResult | null | undefined }) {
34+
if (tls == null) return null
3535
const ok = tls.status === 'ok'
3636
return (
3737
<span
@@ -44,8 +44,8 @@ function TlsBadge({ tls }: { tls: TlsResult | null }) {
4444
)
4545
}
4646

47-
function HttpBadge({ http }: { http: HttpResult | null }) {
48-
if (http === null) return null
47+
function HttpBadge({ http }: { http: HttpResult | null | undefined }) {
48+
if (http == null) return null
4949
const ok = typeof http.status === 'number' && http.status < 500
5050
const label =
5151
typeof http.status === 'number' ? `HTTP ${http.status} ${ms(http.durationMs)}` : 'HTTP ERROR'
@@ -117,7 +117,7 @@ function DiagnosticLog({ steps }: { steps: LogStep[] }) {
117117

118118
function ConnectivityRow({ result }: { name: string; result: ProviderConnectivity }) {
119119
const tcpOk = result.tcp.status === 'ok'
120-
const tlsOk = result.tls === null || result.tls.status === 'ok'
120+
const tlsOk = result.tls == null || result.tls.status === 'ok'
121121

122122
return (
123123
<div className="border border-gray-200 rounded-lg p-4 space-y-2">

0 commit comments

Comments
 (0)