aws / aws-toolkit-jetbrains

AWS Toolkit for JetBrains - a plugin for interacting with AWS from JetBrains IDEs
https://plugins.jetbrains.com/plugin/11349-aws-toolkit
Apache License 2.0
757 stars 220 forks source link

Amazon Q: Read access is allowed from inside read-action only #4848

Closed huypxgear closed 1 month ago

huypxgear commented 2 months ago

Describe the bug Error log appears on the notification

Stacktrace

com.intellij.openapi.diagnostic.RuntimeExceptionWithAttachments: Read access is allowed from inside read-action only (see Application.runReadAction()); see https://jb.gg/ij-platform-threading for details
Current thread: Thread[#33,DefaultDispatcher-worker-6,5,main] 113673939 (EventQueue.isDispatchThread()=false)
SystemEventQueueThread: Thread[#58,AWT-EventQueue-0,6,main] 1110958389
    at com.intellij.util.concurrency.ThreadingAssertions.createThreadAccessException(ThreadingAssertions.java:177)
    at com.intellij.util.concurrency.ThreadingAssertions.softAssertReadAccess(ThreadingAssertions.java:129)
    at com.intellij.openapi.application.impl.ApplicationImpl.assertReadAccessAllowed(ApplicationImpl.java:915)
    at com.intellij.psi.impl.source.PsiFileImpl.assertReadAccessAllowed(PsiFileImpl.java:185)
    at com.intellij.psi.impl.source.PsiFileImpl.getStubTreeOrFileElement(PsiFileImpl.java:694)
    at com.intellij.psi.impl.source.PsiFileImpl.withGreenStubOrAst(PsiFileImpl.java:648)
    at com.intellij.lang.javascript.psi.impl.JSFileBaseImpl.getCachedData(JSFileBaseImpl.java:49)
    at com.intellij.lang.javascript.psi.impl.JSFileBaseImpl.getTestFileType(JSFileBaseImpl.java:108)
    at com.intellij.lang.javascript.psi.impl.JSFileBaseImpl.isTestFile(JSFileBaseImpl.java:103)
    at com.intellij.javascript.testFramework.JsTestFileIndexingHandler.isTestFile(JsTestFileIndexingHandler.java:92)
    at com.intellij.javascript.testing.JsTestSourcesFilter.isTestSource(JsTestSourcesFilter.java:12)
    at com.intellij.openapi.roots.TestSourcesFilter.isTestSources(TestSourcesFilter.java:32)
    at software.aws.toolkits.jetbrains.services.codewhisperer.util.CodeWhispererFileCrawler.isTestFile(CodeWhispererFileCrawler.kt:67)
    at software.aws.toolkits.jetbrains.services.codewhisperer.util.DefaultCodeWhispererFileContextProvider.isTestFile(CodeWhispererFileContextProvider.kt:209)
    at software.aws.toolkits.jetbrains.services.codewhisperer.util.DefaultCodeWhispererFileContextProvider.extractSupplementalFileContext(CodeWhispererFileContextProvider.kt:114)
    at software.aws.toolkits.jetbrains.services.codewhisperer.service.CodeWhispererService$getRequestContext$supplementalContext$1.invokeSuspend(CodeWhispererService.kt:629)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
    at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:608)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:873)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:763)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:750)

Your Environment

holmesjr commented 2 months ago

This isn't the first time either: #3624

This is also happening in WebStorm, so it's not IDE-specific.

DinosaurDad commented 1 month ago

I'm also experiencing this frequently across multiple JetBrains IDEs including WebStorm. Just started for me within the last couple of weeks, but I encounter it many times in a day.

Enoai commented 1 month ago

I am running into this exact same issue on PHPSTORM also, annoying :(

rli commented 1 month ago

Fixed in 3.29

DinosaurDad commented 1 month ago

Fixed in 3.29

Thank you!

Enoai commented 1 month ago

Fixed in 3.29

Legend.