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

Add ChatMessageWrapper class #1141

Merged
merged 1 commit into from
Mar 20, 2024

Conversation

mkondratek
Copy link
Contributor

@mkondratek mkondratek commented Mar 19, 2024

Before this PR it was possible to receive that IDE error:

java.lang.ArrayIndexOutOfBoundsException: No such child: 0
	at java.desktop/java.awt.Container.getComponent(Container.java:350)
	at com.sourcegraph.cody.chat.ui.MessagesPanel.addOrUpdateMessage(MessagesPanel.kt:30)
	at com.sourcegraph.cody.chat.ui.ChatPanel.addOrUpdateMessage(ChatPanel.kt:82)
	at com.sourcegraph.cody.chat.AgentChatSession.addMessageAtIndex(AgentChatSession.kt:260)
	at com.sourcegraph.cody.chat.AgentChatSession.receiveMessage$lambda$6$lambda$5(AgentChatSession.kt:178)

Test plan

  1. switch accounts
  2. quickly write to the chat & send

expected:
the error does not appear (but most likely you will encounter the other issue - #454 (comment))

@mkondratek mkondratek self-assigned this Mar 19, 2024
val contextFilesPanel = messageToUpdate.getComponent(1) as? ContextFilesPanel
singleMessagePanel?.updateContentWith(message.actualMessage())
contextFilesPanel?.updateContentWith(message.contextFiles)
messageToUpdate.singleMessagePanel.updateContentWith(message.actualMessage())
Copy link
Contributor

Choose a reason for hiding this comment

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

❤️

Copy link
Contributor

@pkukielka pkukielka left a comment

Choose a reason for hiding this comment

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

LGTM

@mkondratek mkondratek merged commit cee3b75 into main Mar 20, 2024
7 checks passed
@mkondratek mkondratek deleted the mkondratek/fix/addOrUpdateMessage-error branch March 20, 2024 11:49
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.

None yet

2 participants