Skip to content

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

Closed

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

Activity

  1. added this to the 15 milestone on May 5, 2025
  2. added theissue type on May 5, 2025
  3. self-assigned this
    on May 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions