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

SLI-378 Prefer PasswordSafe to PasswordUtil #858

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

damien-urruty-sonarsource
Copy link
Contributor

No description provided.

@damien-urruty-sonarsource damien-urruty-sonarsource force-pushed the fix/dam/SLI-378-prefer-passwordsafe branch 9 times, most recently from 064e677 to bbc1101 Compare October 31, 2023 10:14
@sonarqube-next
Copy link

Quality Gate passed Quality Gate passed

Kudos, no new issues are introduced in this PR!

0 New issues
0 Security Hotspots
0.0% 0.0% Coverage on New Code
0.0% 0.0% Duplication on New Code

See analysis details on SonarQube

Copy link
Member

@nquinquenel nquinquenel left a comment

Choose a reason for hiding this comment

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

Looks mostly good to me, there is just this nightmare issue with slow operations on EDT

}

private fun loadCredentials(connectionId: String): ServerConnectionCredentials? {
val token = PasswordSafe.instance.getPassword(tokenCredentials(connectionId))
Copy link
Member

Choose a reason for hiding this comment

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

This is a slow operation and it should not be run on the EDT 😢

This is especially annoying because it is called from each IssueNode when rendering

2 stack traces I got:

2023-11-02 11:06:53,403 [  22494] SEVERE - #c.i.u.SlowOperations - Slow operations are prohibited on EDT. See SlowOperations.assertSlowOperationsAreAllowed javadoc.
java.lang.Throwable: Slow operations are prohibited on EDT. See SlowOperations.assertSlowOperationsAreAllowed javadoc.
	at com.intellij.openapi.diagnostic.Logger.error(Logger.java:376)
	at com.intellij.util.SlowOperations.assertNonCancelableSlowOperationsAreAllowed(SlowOperations.java:115)
	at com.intellij.ide.passwordSafe.impl.BasePasswordSafe.get(PasswordSafeImpl.kt:93)
	at com.intellij.credentialStore.CredentialStore.getPassword(CredentialStore.java:30)
	at org.sonarlint.intellij.config.global.ServerConnectionService.loadCredentials(ServerConnectionService.kt:128)
	at org.sonarlint.intellij.config.global.ServerConnectionService.getConnections(ServerConnectionService.kt:52)
	at org.sonarlint.intellij.core.ProjectBindingManager.tryGetServerConnection(ProjectBindingManager.java:148)
	at org.sonarlint.intellij.ui.nodes.IssueNode.retrieveServerConnection(IssueNode.java:59)
	at org.sonarlint.intellij.ui.nodes.IssueNode.doRender(IssueNode.java:71)
	at org.sonarlint.intellij.ui.nodes.IssueNode.lambda$render$0(IssueNode.java:67)
[...]
	at org.sonarlint.intellij.common.ui.ReadActionUtils$Companion.runReadActionSafely(ReadActionUtils.kt:34)
	at org.sonarlint.intellij.common.ui.ReadActionUtils.runReadActionSafely(ReadActionUtils.kt)
	at org.sonarlint.intellij.ui.nodes.IssueNode.render(IssueNode.java:67)
	at org.sonarlint.intellij.ui.tree.TreeCellRenderer.customizeCellRenderer(TreeCellRenderer.java:37)
[...]
	at org.sonarlint.intellij.core.ProjectBindingManager.bindTo(ProjectBindingManager.java:188)
	at org.sonarlint.intellij.config.project.SonarLintProjectSettingsPanel.save(SonarLintProjectSettingsPanel.java:105)
	at org.sonarlint.intellij.config.project.SonarLintProjectConfigurable.apply(SonarLintProjectConfigurable.java:96)
2023-11-02 11:06:44,520 [  13611] SEVERE - #c.i.u.SlowOperations - Slow operations are prohibited on EDT. See SlowOperations.assertSlowOperationsAreAllowed javadoc.
java.lang.Throwable: Slow operations are prohibited on EDT. See SlowOperations.assertSlowOperationsAreAllowed javadoc.
	at com.intellij.openapi.diagnostic.Logger.error(Logger.java:376)
	at com.intellij.util.SlowOperations.assertNonCancelableSlowOperationsAreAllowed(SlowOperations.java:115)
	at com.intellij.ide.passwordSafe.impl.BasePasswordSafe.get(PasswordSafeImpl.kt:93)
	at com.intellij.credentialStore.CredentialStore.getPassword(CredentialStore.java:30)
	at org.sonarlint.intellij.config.global.ServerConnectionService.loadCredentials(ServerConnectionService.kt:128)
	at org.sonarlint.intellij.config.global.ServerConnectionService.getConnections(ServerConnectionService.kt:52)
	at org.sonarlint.intellij.config.global.ServerConnectionService.connectionExists(ServerConnectionService.kt:76)
	at org.sonarlint.intellij.config.project.SonarLintProjectBindPanel.onConnectionSelected(SonarLintProjectBindPanel.java:158)
	at org.sonarlint.intellij.config.project.SonarLintProjectBindPanel$ServerItemListener.itemStateChanged(SonarLintProjectBindPanel.java:415)

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 did not face it on my side... Thanks for testing, I will have to rework the PR then, I will ping you when it's done

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