Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bugs that could lead to an unresponsive IDE when working with project files #5444

Merged

Conversation

keyboardDrummer
Copy link
Member

@keyboardDrummer keyboardDrummer commented May 15, 2024

Description

  • Add option ProjectManagerDatabase.ProjectFileCacheExpiry that allows test to not wait for the cache to expire, something which is otherwise easily forgotten
  • Fix a bug that could lead to a non-responsive IDE when a project file was opened and closed
  • Fix a bug that could lead to a non-responsive IDE when project file changes were made and undone
  • Add defensive coding to prevent disposed project manager from being used (something that occurred in the above two bugs)
  • [No test added] Fix a concurrency bug that could lead to incorrect IDE behavior

How has this been tested?

  • Added an IDE test for each fixed bug

By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.

@keyboardDrummer keyboardDrummer enabled auto-merge (squash) May 15, 2024 09:22
@@ -135,43 +146,49 @@ public class ProjectManagerDatabase : IProjectDatabase {
lock (myLock) {
var projectManagerForFile = managersBySourceFile.GetValueOrDefault(uri);

if (projectManagerForFile is { IsDisposed: true }) {
// Defensive coding
logger.LogError("Found disposed project manager through managersBySourceFile.");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good. At least this will avoid a whole class of issues.

MikaelMayer
MikaelMayer previously approved these changes May 16, 2024
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.

None yet

2 participants