Skip to content

DYN-9719: Python auto migration leaves custom definitions marked as dirty#17185

Merged
jasonstratton merged 1 commit into
DynamoDS:masterfrom
ivaylo-matov:DYN-9719-Python-auto-migration-leaves-custom-definitions-marked-as-dirty
Jun 24, 2026
Merged

DYN-9719: Python auto migration leaves custom definitions marked as dirty#17185
jasonstratton merged 1 commit into
DynamoDS:masterfrom
ivaylo-matov:DYN-9719-Python-auto-migration-leaves-custom-definitions-marked-as-dirty

Conversation

@ivaylo-matov

Copy link
Copy Markdown
Contributor

Purpose

This is a small PR that fixes a bug related to DYN-9719, although it does not have a dedicated Jira ticket.

Problem :

When a graph containing CPython nodes (or custom nodes that contain CPython nodes) is opened, PythonMigrationViewExtension.SetEngine(...) automatically migrates those nodes to PythonNet3 and marks them as modified via OnNodeModified().
Since the graph is not executed during this process, ClearDirtyFlag() is never called, leaving the migrated nodes with IsModified == true. Custom node workspaces are cached and shared by CustomNodeManager, so they remain in memory even after the host graph has been closed.
As a result, when a user attempts to publish a package containing custom nodes that were auto-migrated, PublishManagerViewModel.GetAllFiles(...) detects workspace.HasUnsavedChanges == true and displays a warning that prevents the publishing process from continuing.

Solution :

This PR replaces OnNodeModified() with MarkNodesAsModified(). The new approach sets only the ExecutionHint dirty flag and does not raise the Modified event, preventing NodeModified and HasUnsavedChanges from being updated.

The PR also adds a regression test to PythonMigrationViewExtensionTests.

Before:

Before

After:

After

Declarations

Check these if you believe they are true

Release Notes

Fixes a bug where auto-migrating CPython custom nodes prevents packages being published in the same Dynamo session.

Reviewers

@DynamoDS/eidos
@jasonstratton
@johnpierson

FYIs

@dnenov

@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-9719

@jasonstratton jasonstratton 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.

LGTM

@jasonstratton jasonstratton merged commit 9c66c62 into DynamoDS:master Jun 24, 2026
28 of 31 checks passed
@jasonstratton

Copy link
Copy Markdown
Contributor

@ivaylo-matov , I have merged the PR. You can move the Jira issue to testing

@sonarqubecloud

Copy link
Copy Markdown

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