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

Make SSESessionManager ctor free threaded #4863

Merged
merged 2 commits into from
Sep 8, 2023

Conversation

bigfluffycookie
Copy link
Contributor

part of #4856

}

[Export(typeof(ISSESessionManager))]
[Export(typeof(SSESessionManager))]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We dont use this anywhere else so I removed the interface so it is the same as the TriggerImportInstall class

/// event from the ActiveSolutionBoundTracker)
/// See https://github.com/SonarSource/sonarlint-visualstudio/issues/3886
/// </summary>
private void LoadServicesAndDoInitialUpdates(IComponentModel componentModel)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

With how many there are now I thought it made sense to put it in a seperate method.

Copy link
Contributor

Choose a reason for hiding this comment

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

The doc comment on the method needs to updated.

@@ -64,7 +64,7 @@ protected override async Task InitializeAsync(CancellationToken cancellationToke

logger.WriteLine(Resources.Package_Initializing);

sseSessionManager = componentModel.GetService<ISSESessionManager>();
LoadServicesAndDoInitialUpdates(componentModel);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I moved it up as on line 85 there is an await and this way it doesnt disturb the load order as much

@bigfluffycookie bigfluffycookie marked this pull request as ready for review September 8, 2023 09:07
@bigfluffycookie
Copy link
Contributor Author

A little confused about the dispose code smell as I didnt change anything on that, should I fix it?

/// <summary>
/// Reacts to project changes and opens/closes Server Sent Events sessions
/// </summary>
internal interface ISSESessionManager : IDisposable
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you need to make SSESessionManager : IDisposable now (one of the code smells).

Copy link
Contributor

@duncanp-sonar duncanp-sonar left a comment

Choose a reason for hiding this comment

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

Looks good. A couple of minor comments.

@sonarcloud
Copy link

sonarcloud bot commented Sep 8, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

100.0% 100.0% Coverage
0.0% 0.0% Duplication

idea Catch issues before they fail your Quality Gate with our IDE extension sonarlint SonarLint

@bigfluffycookie bigfluffycookie merged commit a287e80 into branch-hardening-Aug23b Sep 8, 2023
3 of 4 checks passed
duncanp-sonar pushed a commit that referenced this pull request Sep 26, 2023
* Make SSESessionManager ctor free threaded

* pr fixes
ugras-ergun-sonarsource pushed a commit that referenced this pull request Oct 9, 2023
* Make SSESessionManager ctor free threaded

* pr fixes
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.

2 participants