Skip to content

🔧 Refactor team name generation logic for better handling of edge cases#1910

Merged
mkmccarty merged 5 commits intomainfrom
mm-branch-1
Dec 6, 2025
Merged

🔧 Refactor team name generation logic for better handling of edge cases#1910
mkmccarty merged 5 commits intomainfrom
mm-branch-1

Conversation

@mkmccarty
Copy link
Owner

No description provided.

Copilot AI review requested due to automatic review settings December 6, 2025 05:14
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 refactors the team name generation logic in the contract role creation function to better handle edge cases, particularly when all available names are already taken. The changes restructure the control flow to check for empty name lists upfront and modify the fallback mechanism.

Key Changes:

  • Added upfront check for empty unusedRoleNames list with immediate fallback to generated names
  • Refactored the name selection loop to handle the lastChance scenario differently, breaking out of the loop instead of generating a name inline
  • Added additional empty list check during the fallback reset to randomThingNames

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@mkmccarty
Copy link
Owner Author

@copilot open a new pull request to apply changes based on the comments in this thread

Copy link
Contributor

Copilot AI commented Dec 6, 2025

@mkmccarty I've opened a new pull request, #1911, to work on those changes. Once the pull request is ready, I'll request review from you.

mkmccarty and others added 2 commits December 5, 2025 21:20
[WIP] Refactor team name generation logic for better handling of edge cases
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@mkmccarty mkmccarty merged commit f9c5f38 into main Dec 6, 2025
13 checks passed
@mkmccarty mkmccarty deleted the mm-branch-1 branch December 6, 2025 05:23
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.

2 participants