Skip to content

Conversation

@mongodb-devtools-bot
Copy link
Contributor

This PR is automatically generated and updates the versions of the dependency group leafygreen to latest version.

If CI is green on this patch you should feel free to merge it at your convenience.

If CI is red and you think that failures are related to the version updates, you should raise an issue, so that it can be manually resolved and we can continue to update the package group to latest.

@mongodb-devtools-bot mongodb-devtools-bot bot requested a review from a team as a code owner February 7, 2026 00:47
@mongodb-devtools-bot mongodb-devtools-bot bot added bot no-title-validation Skips validation of PR titles (conventional commit adherence + JIRA ticket inclusion) labels Feb 7, 2026
Copy link
Collaborator

@gribnoysup gribnoysup left a comment

Choose a reason for hiding this comment

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

@mabaasit fix looks good, but you can make the code better by avoiding unnecessary explicit type assertions

Comment on lines 568 to 570
const role = (await messageElement.getAttribute('data-role')) as
| 'user'
| 'assistant';
Copy link
Collaborator

Choose a reason for hiding this comment

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

Instead of asserting types, you can add an actual check, which will not only satisfy typescript, but also will make sure that if this breaks, the error points out better what exactly broke

Suggested change
const role = (await messageElement.getAttribute('data-role')) as
| 'user'
| 'assistant';
const role = await messageElement.getAttribute('data-role')
if (role !== 'user' && role !== 'assistant') {
throw new Error(`Expected data-role to be user | assistant, got ${role}`);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot no-title-validation Skips validation of PR titles (conventional commit adherence + JIRA ticket inclusion)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants