Skip to content

Conversation

@chubakueno
Copy link
Contributor

@chubakueno chubakueno commented Jul 7, 2025

Purpose

Prevent graph execution on input nodes autocomplete.

output.mp4

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 graph execution on input nodes autocomplete

Reviewers

@johnpierson
@BogdanZavu

FYIs

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

Copy link

@github-actions github-actions bot left a comment

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-91111

@chubakueno chubakueno changed the title DYN-91111: prevent graph execution on input nodes autocomplete DYN-9111: prevent graph execution on input nodes autocomplete Jul 7, 2025

NodeAutoCompleteUtilities.PostAutoLayoutNodes(node.WorkspaceViewModel.Model, node.NodeModel, transientNodes.Select(x => x.NodeModel), true, true, PortViewModel.PortType, null);

if (PortViewModel.PortType == PortType.Input)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we only want to mark as modified the "first"/left most node in the cluster - that includes the "input cluster" as well. And we use RaisesModificationEvents from below to stop all execution at the beginning of this function and enable it again at the end and only mark as modified the "first"/left most node after that.
Probably a good optimization as well maybe since it ensure a single execution for all nodes involved ?!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This should be the intuitive behavior, but for some reason without this line it doesnt work (havent dug into why)

Copy link
Member

Choose a reason for hiding this comment

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

This actually makes sense because the source node is the triggering node, so marking it as modified since we are now fulfilling the input ports makes sense.

@johnpierson johnpierson requested a review from Copilot July 8, 2025 14:37
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 updates the autocomplete workflow to avoid triggering a graph execution when nodes are autocompleted onto an input port, and temporarily suppresses modification events when adding cluster connectors.

  • Adds a check to only mark input-port nodes as modified instead of requesting a run.
  • Wraps connector creation in a temporary suppression of modification events.
Comments suppressed due to low confidence (2)

src/NodeAutoCompleteViewExtension/ViewModels/NodeAutoCompleteBarViewModel.cs:912

  • [nitpick] Rename oldFlag to something more descriptive like previousRaisesModificationEvents to clarify what the flag represents.
                        var oldFlag = PortViewModel.NodeViewModel.NodeModel.RaisesModificationEvents;

src/NodeAutoCompleteViewExtension/ViewModels/NodeAutoCompleteBarViewModel.cs:310

  • Add a unit test to verify that autocompleting onto an input port does not trigger graph execution and only marks the node as modified.
            if (PortViewModel.PortType == PortType.Input)

Copy link
Member

@johnpierson johnpierson left a comment

Choose a reason for hiding this comment

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

lgtm, marking the source node modified if DNA is triggered on input port makes sense to me.


NodeAutoCompleteUtilities.PostAutoLayoutNodes(node.WorkspaceViewModel.Model, node.NodeModel, transientNodes.Select(x => x.NodeModel), true, true, PortViewModel.PortType, null);

if (PortViewModel.PortType == PortType.Input)
Copy link
Member

Choose a reason for hiding this comment

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

This actually makes sense because the source node is the triggering node, so marking it as modified since we are now fulfilling the input ports makes sense.

chubakueno and others added 2 commits July 10, 2025 19:17
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@johnpierson
Copy link
Member

Rebased from master, but this lgtm. Will merge after checks run

@johnpierson johnpierson merged commit ac1c33c into DynamoDS:master Jul 11, 2025
24 of 25 checks passed
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