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

bug: java.lang.IllegalArgumentException: Cannot add an action twice: Document Code (null) (com.sourcegraph.cody.edit.DocumentCodeA... #1233

Closed
taylorsperry opened this issue Mar 28, 2024 · 0 comments · Fixed by #1279
Assignees
Labels
bug Something isn't working prd-issue

Comments

@taylorsperry
Copy link
Contributor

Cody Version

5.5.1

IDE Information

IntelliJ IDEA 2023.3.3 (Ultimate Edition)
Build #IU-233.14015.106, built on January 24, 2024
Licensed to Sourcegraph / Taylor Sperry
Subscription is active until May 12, 2024.
Runtime version: 17.0.9+7-b1087.11 aarch64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 13.6.4
GC: G1 Young Generation, G1 Old Generation
Memory: 4096M
Cores: 10
Metal Rendering is ON
Registry:
ide.experimental.ui=true
Non-Bundled Plugins:
com.intellij.ml.llm (233.14015.147)
com.sourcegraph.jetbrains (5.5.1-nightly)
Kotlin: 233.14015.106-IJ

Describe the bug

I don't know what the impact of this error is, but I got a notification that an error had occurred after I:

  1. Enabled the inline edits feature flag (I was in the Sourcegraph repo)
  2. I ran a document command and Cody generated documentation; I clicked undo
  3. I switched to the Cody repo
  4. When the Cody repo opened, I saw the error

Expected behavior

Not really sure what's gone wrong, just reporting the notification. I'm still able to send a chat prompt and run the document command. (Though I have not yet thoroughly explored the document command.)

Additional context

Stacktrace:

java.lang.IllegalArgumentException: Cannot add an action twice: Document Code (null) (com.sourcegraph.cody.edit.DocumentCodeAction)
	at com.intellij.openapi.actionSystem.DefaultActionGroup.newDuplicateActionAddedException(DefaultActionGroup.java:143)
	at com.intellij.openapi.actionSystem.DefaultActionGroup.addAction(DefaultActionGroup.java:197)
	at com.intellij.openapi.actionSystem.DefaultActionGroup.add(DefaultActionGroup.java:178)
	at com.sourcegraph.cody.initialization.PostStartupActivity.pushFrontAction(PostStartupActivity.kt:59)
	at com.sourcegraph.cody.initialization.PostStartupActivity.initializeInlineEdits$lambda$1(PostStartupActivity.kt:47)
	at com.intellij.util.concurrency.ContextRunnable.run(ContextRunnable.java:27)
	at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:209)
	at com.intellij.openapi.application.TransactionGuardImpl.access$100(TransactionGuardImpl.java:22)
	at com.intellij.openapi.application.TransactionGuardImpl$1.run(TransactionGuardImpl.java:191)
	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:843)
	at com.intellij.openapi.application.impl.ApplicationImpl$4.run(ApplicationImpl.java:463)
	at com.intellij.openapi.application.impl.RwLockHolder.runWithEnabledImplicitRead(RwLockHolder.kt:75)
	at com.intellij.openapi.application.impl.RwLockHolder.runWithImplicitRead(RwLockHolder.kt:67)
	at com.intellij.openapi.application.impl.ApplicationImpl.runWithImplicitRead(ApplicationImpl.java:1436)
	at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:82)
	at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:124)
	at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:44)
	at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:792)
	at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:739)
	at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:733)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:761)
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.kt:695)
	at com.intellij.ide.IdeEventQueue._dispatchEvent$lambda$12(IdeEventQueue.kt:589)
	at com.intellij.openapi.application.impl.RwLockHolder.runWithoutImplicitRead(RwLockHolder.kt:44)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:589)
	at com.intellij.ide.IdeEventQueue.access$_dispatchEvent(IdeEventQueue.kt:72)
	at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:355)
	at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:354)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:793)
	at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:354)
	at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:349)
	at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$1(IdeEventQueue.kt:1014)
	at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:106)
	at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:1014)
	at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$7(IdeEventQueue.kt:349)
	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:848)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:391)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92)

@taylorsperry taylorsperry added the bug Something isn't working label Mar 28, 2024
@taylorsperry taylorsperry changed the title bug: java.lang.IllegalArgumentException: Cannot add an action twice: Document Code (null) (com.sourcegraph.cody.edit.DocumentCodeA... PRD bug: java.lang.IllegalArgumentException: Cannot add an action twice: Document Code (null) (com.sourcegraph.cody.edit.DocumentCodeA... Apr 2, 2024
@taylorsperry taylorsperry changed the title PRD bug: java.lang.IllegalArgumentException: Cannot add an action twice: Document Code (null) (com.sourcegraph.cody.edit.DocumentCodeA... bug: java.lang.IllegalArgumentException: Cannot add an action twice: Document Code (null) (com.sourcegraph.cody.edit.DocumentCodeA... Apr 2, 2024
@mkondratek mkondratek self-assigned this Apr 3, 2024
mkondratek added a commit that referenced this issue Apr 3, 2024
…1279)

Fixes #1233.


## Test plan

### "Document Code" issue
1. open a project
2. enable inline edits 
3. close project (but keep the IDE on)
4. reopen the project

expected:
no error

### Bundles (#1043)
1. Have Cody plugin installed in your JetBrains IntelliJ IDEA editor
2. User is already logged in to Cody with Pro account
3. Use Cody for a while and click on Cody icon from status bar at bottom
right corner
4. Click on "Manage Accounts" and click on "+" button to add another
account
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working prd-issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants