-
Notifications
You must be signed in to change notification settings - Fork 287
fix(amazonq): improve file change notifications and error handling #6176
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
base: main
Are you sure you want to change the base?
Changes from 2 commits
61386c5
cad66f4
f4d3989
afa9c38
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| { | ||
| "type" : "bugfix", | ||
| "description" : "Amazon Q: Fix profile selection errors and EDT threading violations (#6039)" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| { | ||
| "type" : "bugfix", | ||
| "description" : "Amazon Q: Fix file change notifications not being reflected in IDE and improve error handling in chat commands" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -130,7 +130,10 @@ class DefaultCodeWhispererModelConfigurator( | |
| calculateIfIamIdentityCenterConnection(project) { | ||
| // 1. fetch all profiles, invoke fetch customizations API and get result for each profile and aggregate all the results | ||
| val profiles = QRegionProfileManager.getInstance().listRegionProfiles(project) | ||
| ?: error("Attempted to fetch profiles while there does not exist") | ||
| // Return empty list when no profiles available instead of throwing | ||
| if (profiles.isNullOrEmpty()) { | ||
| return@calculateIfIamIdentityCenterConnection emptyList() | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not expected behavior. We need a profile to proceed
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What happens in the case of null profiles? |
||
| } | ||
|
|
||
| val customizations = profiles.flatMap { profile -> | ||
| runCatching { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,6 +4,7 @@ | |
| package software.aws.toolkits.jetbrains.ui | ||
|
|
||
| import com.intellij.openapi.Disposable | ||
| import com.intellij.openapi.application.ApplicationManager | ||
| import com.intellij.openapi.application.ModalityState | ||
| import com.intellij.openapi.progress.EmptyProgressIndicator | ||
| import com.intellij.openapi.progress.ProgressIndicator | ||
|
|
@@ -92,7 +93,8 @@ class AsyncComboBox<T> private constructor( | |
| currentIndicator?.cancel() | ||
| loading.set(true) | ||
| removeAllItems() | ||
| repaint() | ||
| // Ensure repaint happens on EDT for thread safety | ||
| ApplicationManager.getApplication().invokeLater { repaint() } | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we please add to the description what is the error that we get here? |
||
| val indicator = EmptyProgressIndicator(ModalityState.any()).also { | ||
| currentIndicator = it | ||
| } | ||
|
|
@@ -105,7 +107,8 @@ class AsyncComboBox<T> private constructor( | |
| newModel.invoke(delegatedComboBoxModel(indicator)) | ||
| }.invokeOnCompletion { | ||
| loading.set(false) | ||
| repaint() | ||
| // Ensure repaint happens on EDT for thread safety | ||
| ApplicationManager.getApplication().invokeLater { repaint() } | ||
| } | ||
| }, | ||
| indicator | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need profiles for using the feature