Skip to content

DYN-9707: Fix ForceBlockRun not applied when opening legacy XML workspaces#17167

Merged
jasonstratton merged 2 commits into
DynamoDS:masterfrom
jasonstratton:DYN-9707-fix-xml-path-forceblockrun
Jun 17, 2026
Merged

DYN-9707: Fix ForceBlockRun not applied when opening legacy XML workspaces#17167
jasonstratton merged 2 commits into
DynamoDS:masterfrom
jasonstratton:DYN-9707-fix-xml-path-forceblockrun

Conversation

@jasonstratton

@jasonstratton jasonstratton commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Purpose

Follow-up fix for the ForceBlockRun refactor introduced in #17153 (DYN-9707). The legacy XML workspace open path was not updated to propagate the forceBlockRun flag, leaving HomeWorkspaceModel.RunSettings.ForceBlockRun unset for any .dyn file stored in old XML format.

Declarations

Check these if you believe they are true

Release Notes

N/A — internal fix to file trust enforcement; no user-visible behavior change.

Reviewers

@ivaylo-matov — follow-up to your PR #17153; please take a look.

The regression was caught by DynamoCoreWpfTests.DynamoViewTests.OpeningWorkspaceWithTrustWarning, a test introduced in #17153 itself. The test file TestAdd.dyn is a legacy XML-format file, so the new ForceBlockRun assertion exercised the XML open path. Because DynamoCoreWpfTests is not run in the GitHub Actions PR CI (only in the daily Jenkins build), the failure was not visible before merge.

FYIs

N/A

The ForceBlockRun refactor in DynamoDS#17153 wired the forceBlockRun flag
through the JSON open path (OpenJsonFile) but missed the legacy XML
open path (OpenXmlFileFromPath), leaving ForceBlockRun unset for any
.dyn file in old XML format.

Fix: add forceBlockRun parameter to OpenXmlFileFromPath and set it on
the HomeWorkspaceModel's RunSettings before OpenWorkspace is called,
mirroring what the JSON path already does.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 17, 2026 16:06

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

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

This PR fixes a regression in Dynamo’s legacy XML workspace open path so the forceBlockRun flag is no longer dropped when opening older XML-format .dyn graphs, aligning behavior with the JSON open path and ensuring file-trust blocking is applied consistently.

Changes:

  • Pass forceBlockRun through OpenFileFromPathCore into OpenXmlFileFromPath for legacy XML workspaces.
  • Apply RunSettings.ForceBlockRun to the opened HomeWorkspaceModel before calling OpenWorkspace.

Comment on lines 2465 to +2469
/// <param name="forceManualExecutionMode">Set this to true to discard
/// execution mode specified in the file and set manual mode</param>
/// <param name="isTemplate">When true, marks the opened workspace as a template (for example when opened via <see cref="OpenTemplateFromPath"/>).</param>
/// <returns>True if workspace was opened successfully</returns>
private bool OpenXmlFileFromPath(XmlDocument xmlDoc, string filePath, bool forceManualExecutionMode, bool isTemplate = false)
private bool OpenXmlFileFromPath(XmlDocument xmlDoc, string filePath, bool forceManualExecutionMode, bool isTemplate = false, bool forceBlockRun = false)
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

@jasonstratton jasonstratton requested review from a team, RobertGlobant20 and johnpierson June 17, 2026 17:04

@johnpierson johnpierson left a comment

Copy link
Copy Markdown
Member

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 5c8b032 into DynamoDS:master Jun 17, 2026
29 of 32 checks passed
@ivaylo-matov ivaylo-matov mentioned this pull request Jul 7, 2026
3 tasks
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