You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
If you use an environment variable in the graphql config which is declared twice in .env, the plugin crashes with no visibility why:
It was easy enough to see from the logs why this happened, but an error / warning would be useful within the IDE why would be a good feature to add :)
Additional context
IDE log:
java.lang.IllegalStateException: Duplicate key X (attempted merging values Y and Y)
at java.base/java.util.stream.Collectors.duplicateKeyException(Collectors.java:135)
at java.base/java.util.stream.Collectors.lambda$uniqKeysMapAccumulator$1(Collectors.java:182)
at java.base/java.util.stream.ReduceOps$3ReducingSink.accept(ReduceOps.java:169)
at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)
at io.github.cdimascio.dotenv.DotenvBuilder$DotenvImpl.<init>(DotenvBuilder.java:90)
at io.github.cdimascio.dotenv.DotenvBuilder.load(DotenvBuilder.java:81)
at com.intellij.lang.jsgraphql.ide.config.env.GraphQLConfigEnvironment.findVariableValueInFile(GraphQLConfigEnvironment.kt:156)
at com.intellij.lang.jsgraphql.ide.config.env.GraphQLConfigEnvironment.tryToGetVariableFromDotEnvFile(GraphQLConfigEnvironment.kt:128)
at com.intellij.lang.jsgraphql.ide.config.env.GraphQLConfigEnvironment.getVariable(GraphQLConfigEnvironment.kt:119)
at com.intellij.lang.jsgraphql.ide.config.env.GraphQLConfigEnvironment.createSnapshot(GraphQLConfigEnvironment.kt:75)
at com.intellij.lang.jsgraphql.ide.config.model.GraphQLConfig.initProjects(GraphQLConfig.kt:73)
at com.intellij.lang.jsgraphql.ide.config.model.GraphQLConfig.<init>(GraphQLConfig.kt:46)
at com.intellij.lang.jsgraphql.ide.config.GraphQLConfigProvider.reload(GraphQLConfigProvider.kt:392)
at com.intellij.openapi.progress.util.BackgroundTaskUtil.lambda$runUnderDisposeAwareIndicator$15(BackgroundTaskUtil.java:371)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:217)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$13(CoreProgressManager.java:660)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:735)
at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:691)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:659)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:79)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:202)
at com.intellij.openapi.progress.util.BackgroundTaskUtil.runUnderDisposeAwareIndicator(BackgroundTaskUtil.java:366)
at com.intellij.openapi.progress.util.BackgroundTaskUtil.runUnderDisposeAwareIndicator(BackgroundTaskUtil.java:349)
at com.intellij.lang.jsgraphql.ide.config.GraphQLConfigProvider.scheduleConfigurationReload$lambda$24(GraphQLConfigProvider.kt:361)
at com.intellij.util.concurrency.ChildContext$runAsCoroutine$1.invoke(propagation.kt:81)
at com.intellij.util.concurrency.ChildContext$runAsCoroutine$1.invoke(propagation.kt:81)
at com.intellij.util.concurrency.ChildContext.runAsCoroutine(propagation.kt:86)
at com.intellij.util.concurrency.ChildContext.runAsCoroutine(propagation.kt:81)
at com.intellij.util.Alarm$Request.lambda$runSafely$0(Alarm.java:369)
at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:253)
at com.intellij.util.Alarm$Request.runSafely(Alarm.java:369)
at com.intellij.util.Alarm$Request.run(Alarm.java:356)
at com.intellij.util.concurrency.Propagation.contextAwareCallable$lambda$2(propagation.kt:357)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at com.intellij.util.concurrency.SchedulingWrapper$MyScheduledFutureTask.run(SchedulingWrapper.java:272)
at com.intellij.util.concurrency.BoundedTaskExecutor.doRun(BoundedTaskExecutor.java:244)
at com.intellij.util.concurrency.BoundedTaskExecutor.access$200(BoundedTaskExecutor.java:30)
at com.intellij.util.concurrency.BoundedTaskExecutor$1.executeFirstTaskAndHelpQueue(BoundedTaskExecutor.java:222)
at com.intellij.util.ConcurrencyUtil.runUnderThreadName(ConcurrencyUtil.java:218)
at com.intellij.util.concurrency.BoundedTaskExecutor$1.run(BoundedTaskExecutor.java:210)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:702)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:699)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:699)
at java.base/java.lang.Thread.run(Thread.java:840)
The text was updated successfully, but these errors were encountered:
Describe the bug
If you use an environment variable in the graphql config which is declared twice in .env, the plugin crashes with no visibility why:
It was easy enough to see from the logs why this happened, but an error / warning would be useful within the IDE why would be a good feature to add :)
Additional context
IDE log:
The text was updated successfully, but these errors were encountered: