Skip to content

fix(tracker): make Project.defaultIssueStatus optional#10598

Merged
ArtyomSavchenko merged 1 commit intohcengineering:developfrom
dearlordylord:fix/optional-defaultIssueStatus
Mar 10, 2026
Merged

fix(tracker): make Project.defaultIssueStatus optional#10598
ArtyomSavchenko merged 1 commit intohcengineering:developfrom
dearlordylord:fix/optional-defaultIssueStatus

Conversation

@dearlordylord
Copy link
Contributor

@dearlordylord dearlordylord commented Mar 7, 2026

fixes #10597

The field is undefined at runtime for projects created without an explicit default status (e.g. workspace templates, CreateProject UI with no selection). The platform's own StatusEditor already handles this by falling back to statuses[0]. Making the type honest about the runtime reality surfaces latent bugs at compile time.

Call sites that may need updating:

side effects

to keep it compilable, had to change

migration.ts

This migration remaps old status refs to new status refs. If defaultIssueStatus is undefined, there is no ref to remap, the guard skips a no-op. The DocUpdateMessage activity migration still runs unconditionally for every project, so historical audit records are still migrated even for projects with no current defaultIssueStatus.

Tested on

Huly v0.7.353 (self-hosted), REST API via @hcengineering/api-client.

@huly-github-staging
Copy link

Connected to Huly®: UBERF-15804

defaultIssueStatus is not reliably populated for all projects.Make the field optional in the type definition and guard the
  migration to handle undefined values.

Signed-off-by: Igor Loskutov <igor.loskutoff@gmail.com>
@dearlordylord dearlordylord force-pushed the fix/optional-defaultIssueStatus branch from 2904d0d to 22af175 Compare March 9, 2026 15:34
@dearlordylord
Copy link
Contributor Author

updated to passing CI

@ArtyomSavchenko
Copy link
Member

Hi @dearlordylord
Thanks for your contribution

@ArtyomSavchenko ArtyomSavchenko merged commit badeb2e into hcengineering:develop Mar 10, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

(Type safety) Project.defaultIssueStatus typed as required but undefined at runtime

2 participants