Skip to content

Conversation

@ulugbekna
Copy link
Contributor

Problem

The isCustomTeamDefaultValue type guard was only checking for defaultValue and teamDefaultValue properties, allowing objects missing owner and expirationDate to pass the check. This caused runtime errors when accessing expirationDate:

TypeError: Cannot read properties of undefined (reading 'expirationDate')
    at toBaseConfig (evalmachine.<anonymous>:24996:50)

Solution

Updated the type guard to check for all four required properties of CustomTeamDefaultValue<T>:

  • defaultValue
  • teamDefaultValue
  • owner
  • expirationDate

The type guard was only checking for 'defaultValue' and 'teamDefaultValue'
properties, allowing objects missing 'owner' and 'expirationDate' to pass
the check. This caused runtime errors when accessing expirationDate on
incomplete objects.

Now checks for all four required properties of CustomTeamDefaultValue<T>.
Copilot AI review requested due to automatic review settings January 30, 2026 13:03
@vs-code-engineering vs-code-engineering bot added this to the February 2026 milestone Jan 30, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a critical bug in the isCustomTeamDefaultValue type guard that was causing runtime errors when accessing properties of CustomTeamDefaultValue objects.

Changes:

  • Updated the isCustomTeamDefaultValue type guard to check all four required properties (defaultValue, teamDefaultValue, owner, expirationDate) instead of just two, preventing objects missing required properties from passing the type guard check.

benibenj
benibenj previously approved these changes Jan 30, 2026
@ulugbekna ulugbekna added this pull request to the merge queue Jan 30, 2026
Merged via the queue into main with commit 1058fdd Jan 30, 2026
19 checks passed
@ulugbekna ulugbekna deleted the fix/config-type-guard-check branch January 30, 2026 14:57
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.

3 participants