Description
Object.values(HealthStatus)[numericValue] returns undefined for any index outside 0–2 (e.g., 3, -1, or a new enum value added server-side). When label is undefined, colorVariants[undefined] also returns undefined, silently passing undefined to downstream UI components that expect strings — causing React rendering crashes (e.g., "Objects are not valid as a React child"). This function consumes gRPC/protobuf enum values, which can legitimately carry unexpected numeric values from newer server versions.
Severity: high
File: ui/packages/app/web/src/components/Targets/utils.ts
Expected Behavior
The code should handle this case properly to avoid unexpected errors or degraded quality.
Description
Object.values(HealthStatus)[numericValue]returnsundefinedfor any index outside 0–2 (e.g., 3, -1, or a new enum value added server-side). Whenlabelisundefined,colorVariants[undefined]also returnsundefined, silently passingundefinedto downstream UI components that expect strings — causing React rendering crashes (e.g., "Objects are not valid as a React child"). This function consumes gRPC/protobuf enum values, which can legitimately carry unexpected numeric values from newer server versions.Severity:
highFile:
ui/packages/app/web/src/components/Targets/utils.tsExpected Behavior
The code should handle this case properly to avoid unexpected errors or degraded quality.