Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve node autocomplete results for custom node output ports #14218

Merged
merged 5 commits into from
Aug 7, 2023

Conversation

mjkkirschner
Copy link
Member

@mjkkirschner mjkkirschner commented Aug 2, 2023

Purpose

I could not reproduce the crash seen in #14192 in master (2.19).

I did notice however that checking customNode outputs frequently throws thousands of exceptions and also fails to find results even when the type name is a valid type!

I've made two changes I think will improve the situation a small bit.

  1. When we encounter a space in a custom node output port name, we just use the first word, it at least has a non zero chance of being a type name.
  2. when we look for matching types we use the Type.Name instead of Type.ToString() ToString will also include rank, like var[]..[] - this is not a valid class name that can be found in the class table, and so we never make any matches with types that include rank. After this PR we'll better match different ranks of type, and also derived types.

Note how more valid results are returned in the tests I have updated. Also less exceptions are thrown, so the results are computed a bit faster.

Declarations

Check these if you believe they are true

  • The codebase is in a better state after this PR
  • 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
  • All tests pass using the self-service CI.
  • 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

Release Notes

Return more results for object based node autocomplete when using custom node output ports.

Reviewers

(FILL ME IN) Reviewer 1 (If possible, assign the Reviewer for the PR)

(FILL ME IN, optional) Any additional notes to reviewers or testers.

FYIs

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

dont use type string, use name
dont use name with spaces, it will never be correct.
@mjkkirschner mjkkirschner changed the title Autocrash improve node autocomplete results for custom node output ports Aug 2, 2023
@QilongTang QilongTang added this to the 2.19.0 milestone Aug 3, 2023
searchViewModel.PopulateAutoCompleteCandidates();
Assert.AreEqual(7, searchViewModel.FilteredResults.Count());
Assert.AreEqual(44, searchViewModel.FilteredResults.Count());
Copy link
Contributor

Choose a reason for hiding this comment

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

wow

@QilongTang
Copy link
Contributor

Regression:
Dynamo.Tests.FileLibraryTests.Directory_Move is this real?

@@ -760,6 +760,11 @@ internal IEnumerable<NodeSearchElement> GetMatchingSearchElements()
else if (PortViewModel.PortModel.PortType == PortType.Output)
{
portType = PortViewModel.PortModel.GetOutPortType();
//if the custom node output name contains spaces, try using the first word.
if (PortViewModel.PortModel.Owner is Graph.Nodes.CustomNodes.Function && portType.Contains(" "))
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we generalize this check to include any white space?

Copy link
Member Author

Choose a reason for hiding this comment

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

I can do that- I don't think any whitespace character is valid in a DS type name.

@mjkkirschner
Copy link
Member Author

@QilongTang I don't think so -
next run has one of these awesome failures:

setUp : System.Exception : Could not load geometry library binaries from : C:\Jenkins\workspace\Dynamo\DynamoSelfServe\pullRequestValidation\Dynamo\bin\AnyCPU\Release\libg_229_0_0 System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.SEHException: External component has thrown an exception.
   --- End of inner exception stack trace ---

I'm going to merge this, if we see an increase in failures after this is merged, we can revert it.

@mjkkirschner
Copy link
Member Author

I'm going to merge this - as @aparajit-pratap said the test failures also happen on master at this point.

@mjkkirschner mjkkirschner merged commit e7d76a6 into DynamoDS:master Aug 7, 2023
@mjkkirschner mjkkirschner deleted the autocrash branch August 7, 2023 13:05
sm6srw pushed a commit to sm6srw/Dynamo that referenced this pull request Mar 22, 2024
…oDS#14218)

* update tests
dont use type string, use name
dont use name with spaces, it will never be correct.

* add a new test

* comments

* review comments and new test
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.

4 participants