stride3d / stride3d/stride

Project in Launcher window sometimes disappears when selected

Open
#1,164 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area-Launcher bug
Dominant language
C#
Stars
7.8k
Forks
1.2k
Avg merge
2d 17h
Merged PRs (30d)
49

Description

Release Type: Official Release
Version: Launcher v5.0.5

Platform(s): Windows 7

Describe the bug
Sometimes when you open your project in the Stride Launcher window it'll be removed from the list.
You are then required to open it via Browse button in the Project selection window.

To Reproduce
Steps to reproduce the behavior:

  1. Open your project in the Launcher window. It's a gamble if it stays or not.

Expected behavior
Project should stay on the list.

Additional context
I looked into it a long time ago, but have forgotten about the details and don't know how to fix this.
Files that may or may not be relevant:

https://github.com/stride3d/stride/blob/cf24da84bb47fd0bfcdb2f60854992fe09b63a52/sources/launcher/Stride.Launcher/ViewModels/LauncherViewModel.cs#L568

https://github.com/stride3d/stride/blob/7e836297cb5930c01e6dfa0183e7f3cc64748fb6/sources/core/Stride.Core.Design/Settings/SettingsProfile.cs

https://github.com/stride3d/stride/blob/7e836297cb5930c01e6dfa0183e7f3cc64748fb6/sources/core/Stride.Core.Design/Settings/SettingsContainer.cs

https://github.com/stride3d/stride/blob/7e836297cb5930c01e6dfa0183e7f3cc64748fb6/sources/editor/Stride.Core.MostRecentlyUsedFiles/MostRecentlyUsedFileCollection.cs

From what I vaguely recall about the issue, there might be a couple of issues going on.
FileSystemWatcher is considered unreliable/not well behaved. From my testing, sometimes FileSystemWatcher will flood the Changed event when saving the user's profile settings file, causing multiple reloads (as per SettingsProfile).
When you select a project to open, LauncherViewModel.StartStudio is called from RecentProjectViewModel, which calls LauncherSettings.Save, which will then trigger FileSystemWatcher's events, which then SettingsProfile will reload the settings file.
The part I don't fully remember is how it is sometimes able to hold the project list without the project you selected to open, then I believe decides to save your settings with that list (ie. causing the save to occur without the selected project). I believe this happens somewhere in the midst of the save/FileSystemWatcher.Change reload events.
One possibility I'm wondering is if it might be that Game Studio is also registering FileSystemWatcher on its own SettingsProfile causing interference between the two apps.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with LauncherViewModel.cs around StartStudio and trace LauncherSettings.Save through SettingsProfile.cs, SettingsContainer.cs, and MostRecentlyUsedFileCollection.cs. Reproduce the project selection flow on Windows and inspect the FileSystemWatcher reload sequence; done means the selected project reliably remains in the Launcher list after opening.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
desktop, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.