DYN-9707: Revert GraphLock#17210
Conversation
…ML workspaces (DynamoDS#17167)" This reverts commit 5c8b032.
This reverts commit 1269d5b.
…mo instance (DynamoDS#17139)" This reverts commit 4e2d513.
note : TestTOUWorkspaceClose(...) fails
There was a problem hiding this comment.
See the ticket for this pull request: https://jira.autodesk.com/browse/DYN-9707
There was a problem hiding this comment.
Pull request overview
Reverts the graph file locking feature (the .dynlock sidecar mechanism, conflict UI, and related tests) while keeping/re-applying the file trust / ForceBlockRun plumbing improvements so untrusted graphs are blocked consistently during open/insert.
Changes:
- Removed graph-lock infrastructure (
GraphLockManager,.dynlocksupport types), WPF conflict prompt, and associated unit tests/resources. - Simplified file open path in
DynamoModelto remove lock acquisition/redirect/cancel logic while still propagatingforceBlockRunfor JSON and legacy XML graphs. - Updated WPF open/insert flows and message box helper signature to reflect the removal of graph-lock UI.
Reviewed changes
Copilot reviewed 16 out of 19 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| test/DynamoCoreTests/Models/FileTrustHeadlessTests.cs | Minor formatting adjustment in trust precondition helper. |
| test/DynamoCoreTests/Graph/Workspaces/GraphLockManagerTests.cs | Removes unit tests for graph lock acquisition/conflict behaviors. |
| src/DynamoCoreWpf/Views/FileTrust/FileTrustWarning.xaml.cs | Formatting-only change in popup activation condition. |
| src/DynamoCoreWpf/ViewModels/Core/DynamoViewModel.cs | Removes graph-lock prompt hookup and cancel/redirect handling in Open; clarifies trust-warning timing for Insert. |
| src/DynamoCoreWpf/UI/Prompts/DynamoMessageBox.xaml.cs | Removes unused maxWidth parameter from the internal owner+custom-buttons overload. |
| src/DynamoCoreWpf/Services/WpfGraphLockUserPrompt.cs | Deletes the WPF conflict prompt implementation for graph-lock. |
| src/DynamoCoreWpf/PublicAPI.Unshipped.txt | Removes unshipped public resource entries related to graph-lock strings. |
| src/DynamoCoreWpf/Properties/Resources.resx | Removes base graph-lock resource strings. |
| src/DynamoCoreWpf/Properties/Resources.en-US.resx | Removes en-US graph-lock resource strings. |
| src/DynamoCoreWpf/Properties/Resources.Designer.cs | Removes strongly-typed accessors for graph-lock strings; shows broader regeneration churn. |
| src/DynamoCoreWpf/DynamoCoreWpf.csproj | Removes compile include for deleted WpfGraphLockUserPrompt.cs. |
| src/DynamoCore/Models/DynamoModel.cs | Removes graph-lock integration; retains JSON/XML open paths with forceBlockRun propagation. |
| src/DynamoCore/Graph/Workspaces/Locking/IGraphLockUserPrompt.cs | Deletes graph-lock core UI prompt contract. |
| src/DynamoCore/Graph/Workspaces/Locking/GraphLockUserResponse.cs | Deletes graph-lock user response type. |
| src/DynamoCore/Graph/Workspaces/Locking/GraphLockResult.cs | Deletes graph-lock acquire result type. |
| src/DynamoCore/Graph/Workspaces/Locking/GraphLockOutcome.cs | Deletes graph-lock outcome enum. |
| src/DynamoCore/Graph/Workspaces/Locking/GraphLockManager.cs | Deletes graph-lock manager implementation. |
| src/DynamoCore/Graph/Workspaces/Locking/GraphLockInfo.cs | Deletes graph-lock metadata type. |
| src/DynamoCore/Graph/Workspaces/Locking/GraphLockFile.cs | Deletes .dynlock file IO implementation. |
Files not reviewed (1)
- src/DynamoCoreWpf/Properties/Resources.Designer.cs: Generated file
| // These kind of exceptions indicate that file is not accessible | ||
| if (ex is IOException || ex is UnauthorizedAccessException) | ||
| { | ||
| LastGraphLockOpenOutcome = GraphLockOutcome.RedirectedToCopy; | ||
| throw ex; | ||
| } |
| else | ||
| { | ||
| // These kind of exceptions indicate that file is not accessible | ||
| if (ex is IOException || ex is UnauthorizedAccessException) | ||
| { | ||
| throw ex; | ||
| } | ||
|
|
||
| XmlDocument xmlDoc; | ||
|
|
||
| // When Json opening failed, either this file is corrupted or file might be XML | ||
| if (ex is JsonReaderException && DynamoUtilities.PathHelper.isValidXML(filePathToOpen, out xmlDoc, out ex)) | ||
| { | ||
| openedSuccessfully = OpenXmlFileFromPath(xmlDoc, filePathToOpen, forceManualExecutionMode, forceBlockRun: forceBlockRun); | ||
| return; | ||
| } | ||
| else | ||
| { | ||
| throw ex; | ||
| } | ||
| throw ex; | ||
| } |
| /// <summary> | ||
| /// Looks up a localized string similar to From Template.... | ||
| /// Looks up a localized string similar to _Template. | ||
| /// </summary> | ||
| public static string DynamoViewFileMenuOpenTemplate { |
| // This class was auto-generated by the StronglyTypedResourceBuilder | ||
| // class via a tool like ResGen or Visual Studio. | ||
| // To add or remove a member, edit your .ResX file then rerun ResGen | ||
| // with the /str option, or rebuild your VS project. | ||
| [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "18.0.0.0")] | ||
| [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] | ||
| [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
|
RobertGlobant20
left a comment
There was a problem hiding this comment.
LGTM
Confirmed this is a clean selective revert — the graph-lock feature (GraphLockManager, .dynlock sidecars, conflict UI, and tests) is fully removed with no dangling references, while the FileTrust/ForceBlockRun improvements from #17153/#17167 are correctly retained. Build integrity and the re-applied open/insert trust-warning logic verified. 👍



Purpose
Revert the graph file locking feature introduced in #17139 and remove all related infrastructure -
.dynlocksidecar files,GraphLockManager, conflict dialog, and tests.The three squash-merge commits from DYN-9707 were reverted in reverse order:
forceBlockRunfixForceBlockRuninstance refactor and file trust command plumbing.dynlockfiles, and conflict UIGraph lock is intentionally removed. The FileTrust /
ForceBlockRunimprovements from #17153 and #17167 are re-applied in a follow-up commit on this branch, without any graph-lock integration.Key changes:
GraphLockManagerand locking types undersrc/DynamoCore/Graph/Workspaces/Locking/WpfGraphLockUserPrompt, graph-lock UI strings (defaultResources.resx/Resources.en-US.resx), andGraphLockManagerTestsDynamoModel/DynamoViewModelRunSettings.ForceBlockRun,forceBlockRunplumbing through open/insert commands, stale file-trust warning fixes, and regression tests from DYN-9707: Refactor ForceBlockRun to instance #17153 / DYN-9707: Fix ForceBlockRun not applied when opening legacy XML workspaces #17167RunSettings.ForceBlockRunrestored as an instance property;PublicAPI.Unshipped.txtupd#17153 / #17167ated inDynamoCoreDeclarations
Check these if you believe they are true
Release Notes
Dynamo no longer creates
.dynlocksidecar files or warns when opening a graph file that is already open in another Dynamo instance.Reviewers
@DynamoDS/eidos
@johnpierson
@RobertGlobant20
FYIs
@dnenov
@jasonstratton