From 8edc00ef2292a7da6cddb1d6162094ef71faf774 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20Kondratek?= Date: Wed, 7 Aug 2024 13:08:11 +0200 Subject: [PATCH] Call `getAuthenticationState` on a pooled thread instead of EDT (#1996) No need to call this method on EDT (at least not there). ## Test plan 1. `runIde` 2. verify that the error does not appear in the logs --- .../com/sourcegraph/cody/config/CodyAuthenticationManager.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/com/sourcegraph/cody/config/CodyAuthenticationManager.kt b/src/main/kotlin/com/sourcegraph/cody/config/CodyAuthenticationManager.kt index 012edbcea0..19a5759918 100644 --- a/src/main/kotlin/com/sourcegraph/cody/config/CodyAuthenticationManager.kt +++ b/src/main/kotlin/com/sourcegraph/cody/config/CodyAuthenticationManager.kt @@ -2,6 +2,7 @@ package com.sourcegraph.cody.config import com.intellij.collaboration.async.CompletableFutureUtil.submitIOTask import com.intellij.openapi.Disposable +import com.intellij.openapi.application.ApplicationManager import com.intellij.openapi.application.ModalityState import com.intellij.openapi.components.PersistentStateComponent import com.intellij.openapi.components.Service @@ -83,7 +84,7 @@ class CodyAuthenticationManager(val project: Project) : object : WindowAdapter() { override fun windowActivated(e: WindowEvent?) { super.windowActivated(e) - getAuthenticationState() + ApplicationManager.getApplication().executeOnPooledThread { getAuthenticationState() } } } frame?.addWindowListener(listener)