Skip to content

fix: gethealthstatus crashes on out-of-range numeric values from protobuf #6372

Description

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions