Skip to content

DYN-8941: dont crash when theres no cluster results#16264

Merged
chubakueno merged 2 commits into
DynamoDS:masterfrom
chubakueno:feature/DYN-8941
Jun 4, 2025
Merged

DYN-8941: dont crash when theres no cluster results#16264
chubakueno merged 2 commits into
DynamoDS:masterfrom
chubakueno:feature/DYN-8941

Conversation

@chubakueno

Copy link
Copy Markdown
Contributor

Purpose

Prevent crashes when theres no cluster results.

Declarations

Check these if you believe they are true

  • Is documented according to the standards
  • The level of testing this PR includes is appropriate
  • User facing strings, if any, are extracted into *.resx files
  • Snapshot of UI changes, if any.
  • Changes to the API follow Semantic Versioning and are documented in the API Changes document.
  • This PR modifies some build requirements and the readme is updated
  • This PR contains no files larger than 50 MB
  • This PR introduces new feature code involve network connecting and is tested with no-network mode.

Release Notes

Prevent crashes when theres no cluster results.

Reviewers

@BogdanZavu
@johnpierson

FYIs

(FILL ME IN, Optional) Names of anyone else you wish to be notified of

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

See the ticket for this pull request: https://jira.autodesk.com/browse/DYN-8941

@johnpierson johnpierson self-requested a review June 4, 2025 12:49

@johnpierson johnpierson left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm, we might need to add a task to have a textbox appear that says no results found or something similar to alert the user.

@johnpierson johnpierson requested a review from Copilot June 4, 2025 12:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 ensures that the UI does not crash when there are no cluster results by adding a guard condition before processing cluster items.

  • Added a guard to only run cluster-related code when comboboxResults contains items.
  • Updated the logic that handles setting the SelectedIndex and adding a cluster result.
Comments suppressed due to low confidence (2)

src/NodeAutoCompleteViewExtension/ViewModels/NodeAutoCompleteBarViewModel.cs:1039

  • Accessing QualifiedResults.First() without checking if QualifiedResults is non-empty could still cause a crash; consider adding a condition to ensure QualifiedResults contains at least one element.
var ClusterResultItem = QualifiedResults.First();

src/NodeAutoCompleteViewExtension/ViewModels/NodeAutoCompleteBarViewModel.cs:1039

  • [nitpick] Consider renaming 'ClusterResultItem' to use camelCase (e.g., 'clusterResultItem') to follow C# naming conventions for local variables.
var ClusterResultItem = QualifiedResults.First();

@johnpierson johnpierson added the ai/ml 🧠 synapse team related PRs label Jun 4, 2025
@chubakueno chubakueno merged commit afe368c into DynamoDS:master Jun 4, 2025
24 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai/ml 🧠 synapse team related PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants