Skip to content

DYN-9998 GraphNodeManager Crash#17054

Merged
RobertGlobant20 merged 4 commits into
masterfrom
DYN-9998-GraphNodeManager-Crash-EmptyW
Apr 20, 2026
Merged

DYN-9998 GraphNodeManager Crash#17054
RobertGlobant20 merged 4 commits into
masterfrom
DYN-9998-GraphNodeManager-Crash-EmptyW

Conversation

@RobertGlobant20

Copy link
Copy Markdown
Contributor

Purpose

Fix Graph Node Manager CSV export crash on empty/new workspaces by adding safe filename fallbacks, empty-data guards in JSON-to-CSV conversion, and a regression test.

  • GraphNodeManagerView.xaml.cs: Make export default filename safe for unsaved workspaces by falling back to workspace name, then GraphNodes.

  • Utilities.cs: Harden CSV export for empty data by returning empty output safely and avoiding JSON-to-CSV conversion crashes on empty/null payloads.

  • GraphNodeManagerViewExtensionTests.cs: Add regression test to verify jsonToCSV handles [] without throwing and returns no rows.

Declarations

Check these if you believe they are true

Release Notes

Fix Graph Node Manager CSV export crash on empty/new workspaces

Reviewers

@QilongTang @zeusongit @aparajit-pratap

FYIs

Fix Graph Node Manager CSV export crash on empty/new workspaces by adding safe filename fallbacks, empty-data guards in JSON-to-CSV conversion, and a regression test.

- GraphNodeManagerView.xaml.cs: Make export default filename safe for unsaved workspaces by falling back to workspace name, then GraphNodes.

- Utilities.cs: Harden CSV export for empty data by returning empty output safely and avoiding JSON-to-CSV conversion crashes on empty/null payloads.

- GraphNodeManagerViewExtensionTests.cs: Add regression test to verify jsonToCSV handles [] without throwing and returns no rows.

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

@RobertGlobant20

Copy link
Copy Markdown
Contributor Author

GIF showing that there is no crash now.
NodeManagerExportCrashNoCrash

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

Fixes a Graph Node Manager export crash scenario for new/empty workspaces by making the default export filename safer and hardening JSON-to-CSV conversion against empty inputs, with a regression test.

Changes:

  • Add safe fallback logic for the export default filename when the current workspace hasn’t been saved.
  • Guard CSV export / JSON-to-CSV conversion to safely return empty output for empty/null payloads.
  • Add a regression test verifying jsonToCSV("[]") returns no rows and doesn’t throw.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/GraphNodeManagerViewExtension/GraphNodeManagerView.xaml.cs Adds filename fallback logic when workspace filename is unavailable.
src/GraphNodeManagerViewExtension/Utilities/Utilities.cs Adds empty-input/empty-table guards to prevent JSON→CSV conversion crashes and handles empty CSV output.
test/DynamoCoreWpf2Tests/ViewExtensions/GraphNodeManagerViewExtensionTests.cs Adds a regression test for empty-array JSON conversion behavior.

Comment thread src/GraphNodeManagerViewExtension/GraphNodeManagerView.xaml.cs
Comment thread test/DynamoCoreWpf2Tests/ViewExtensions/GraphNodeManagerViewExtensionTests.cs Outdated
Prevent Graph Node Manager export crashes on new/empty workspaces by sanitizing default export file names (invalid chars and reserved names) and hardening CSV conversion for empty payloads; add regression tests for empty JSON-to-CSV and filename sanitization behavior.
Removed Assert.DoesNotThrow wrapper from JsonToCsvWithEmptyArrayReturnsNoRows.
Now it directly calls jsonToCSV("[]") and asserts:
Assert.IsNotNull(csvLines)
Assert.IsEmpty(csvLines)
This gives clearer assertion failures if behavior regresses. No file-level errors were reported after the change.
@sonarqubecloud

Copy link
Copy Markdown

@RobertGlobant20

Copy link
Copy Markdown
Contributor Author

@zeusongit zeusongit 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, feel free to merge @RobertGlobant20

@RobertGlobant20 RobertGlobant20 merged commit 832974d into master Apr 20, 2026
28 of 31 checks passed
@RobertGlobant20 RobertGlobant20 deleted the DYN-9998-GraphNodeManager-Crash-EmptyW branch April 20, 2026 15:39
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