Skip to content

Runtime error due to unhandled API null auto restart policy #2820

@david-crespo

Description

@david-crespo

The whole instance page blows up when an instance is marked failed with an unset auto restart policy. The error is thrown by this ts-pattern match call, which blows up to tell you you have an unhandled case.

{match(policy)
.with('never', () => (
<Badge color="neutral" variant="solid">
never
</Badge>
))
.with('best_effort', () => <Badge>best effort</Badge>)
.with(undefined, () => <Badge color="neutral">Default</Badge>)
.exhaustive()}

Strictly speaking this is only a manifestation of the real bug in the TS client generator, which does not generate | null on types that can in fact be null. This means that in the console we do not handle the possibility of null adequately.

autoRestartPolicy?: InstanceAutoRestartPolicy

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions