Editor: Warn before duplicate project session (#10739)#10792
Open
calbebop wants to merge 2 commits intoFacepunch:masterfrom
Open
Editor: Warn before duplicate project session (#10739)#10792calbebop wants to merge 2 commits intoFacepunch:masterfrom
calbebop wants to merge 2 commits intoFacepunch:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a per-
.sbprojsession mutex so a second editor for the same project shows a Project already open dialog (Cancel / Open anyway) instead of stacking instances silently. The lock is taken early in editor startup (afterLoadMinimal, beforeInitGame) so the prompt appears during load, not only after the main window is up. The standalone launcher checks the same lock before spawningsbox-dev.Motivation & Context
Opening the same project in multiple editors causes confusing state and wasted work. This makes the duplicate case explicit and matches expectations for a desktop tool.
Fixes: #10739
Implementation Details
ProjectEditorSessionLock: SHA-256–based named mutex (Local\...on Windows), path normalization aligned withProject.AddFromFile, modal viaPopupDialogWidget, release onToolsDll.Exiting.EditorAppSystem.CheckProject: acquire lock / prompt after successfulLoadMinimal.StartupLoadProject.OpenProject: load using normalized path; recent project list usesProject.Current.ConfigFilePath.HomeWidget.OpenProject:TryConfirmLaunchFromHubBeforeSpawnbeforeProcess.Start.Note: A very tight race remains if two processes start before either creates the mutex; normal use and hub flow are covered.
Screenshots / Videos (if applicable)
Checklist
ProjectEditorSessionLockTests(fullSandbox.Test.Unitmay require local Steam/unittest assets)