DYN-9998 GraphNodeManager Crash#17054
Conversation
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.
There was a problem hiding this comment.
See the ticket for this pull request: https://jira.autodesk.com/browse/DYN-9998
There was a problem hiding this comment.
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. |
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.
|
|
Dynamo SelfServe passed here: https://c007.cloudbees-ci.autodesk.com/job/DYNCI/job/Dynamo/job/DynamoSelfServe/job/pullRequestValidation/120/ |
zeusongit
left a comment
There was a problem hiding this comment.
LGTM, feel free to merge @RobertGlobant20




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