Skip to content

DYN-9707 : Show warning when a file is opened in another Dynamo instance#17139

Merged
jasonstratton merged 14 commits into
DynamoDS:masterfrom
ivaylo-matov:DYN-9707-Warning-when-the-Dyn-file-is-opened-in-another-Dynamo-instance
Jun 9, 2026
Merged

DYN-9707 : Show warning when a file is opened in another Dynamo instance#17139
jasonstratton merged 14 commits into
DynamoDS:masterfrom
ivaylo-matov:DYN-9707-Warning-when-the-Dyn-file-is-opened-in-another-Dynamo-instance

Conversation

@ivaylo-matov

Copy link
Copy Markdown
Contributor

Purpose

This PR addresses DYN-9707:

The proposed logic adds a graph-file locking mechanism so Dynamo can detect when a .dyn or .dyf file is already open in another Dynamo instance and help avoid conflicting edits.

Changes:

  • added core graph lock sidecar support using .dynlock files.
  • added lock acquisition, heartbeat refresh, stale-lock takeover, and release behavior.
  • integrated graph locking into DynamoModel.OpenFileFromPath.
  • added WPF conflict prompt with Cancel and Save As options.
  • added localized prompt resources and PublicAPI entries for new resource strings.
  • updated the open-file UI flow to handle cancelled opens and Save As copy redirects.
  • added regression tests for lock creation/release, stale lock takeover, Cancel, and Save As prompt outcomes.
DYN-9707

Declarations

Check these if you believe they are true

Release Notes

Dynamo now warns before opening a graph already open in another instance.

Reviewers

@DynamoDS/eidos
@jasonstratton

FYIs

@dnenov
@johnpierson

@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

@jasonstratton

Copy link
Copy Markdown
Contributor

We discussed in the check-in today the possibility of orphaned lock files. The logic still seems sound. We discussed the length of the timeout of 90 seconds being reasonable, which I think it is, but there is an edge case to consider.

If the user has two instances of Dynamo open with a file open in one of them and Dynamo crashes, it is conceivable that the user could switch to the other instance and try to open the file, which now had an orphaned lock file, fairly quickly and well under the 90 seconds.

It's probably a rare case, but it would be confusing if a user runs into it as the two options presented are to cancel opening the file and to create a copy of the file. It might merit some sort of text that explains this possibility? It might be overly verbose and almost never relevant though.

@johnpierson , what do you think?

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

I had a couple of comments, but only one code change needed.

Great work! Thank you.

Comment thread src/DynamoCore/Graph/Workspaces/Locking/GraphLockManager.cs
Comment thread src/DynamoCoreWpf/ViewModels/Core/DynamoViewModel.cs Outdated
Comment thread src/DynamoCore/Graph/Workspaces/Locking/GraphLockFile.cs
Comment thread src/DynamoCore/Graph/Workspaces/Locking/GraphLockResult.cs
@sonarqubecloud

sonarqubecloud Bot commented Jun 8, 2026

Copy link
Copy Markdown

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

Thank you!

@jasonstratton jasonstratton merged commit 4e2d513 into DynamoDS:master Jun 9, 2026
28 of 29 checks passed
@ivaylo-matov

Copy link
Copy Markdown
Contributor Author

Thank you!

Thanks you @jasonstratton

I pushed a follow-up PR here #17153.

@jasonstratton

Copy link
Copy Markdown
Contributor

I pushed a follow-up PR here #17153.

Thank you @ivaylo-matov . I did see the PR. Is it ready to review? ... I suppose I should ask there. 😄

@johnpierson

Copy link
Copy Markdown
Member

I actually ran into the "orphaned dynlock" file myself when testing another issue that resulted in a hard crash.

@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