-
Notifications
You must be signed in to change notification settings - Fork 485
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
fix(amazonq): tutorial always showing on start #5949
Conversation
|
@@ -122,6 +122,9 @@ export class InlineChatController { | |||
} | |||
|
|||
public async updateTaskAndLenses(task: InlineTask, taskState?: TaskState) { | |||
if (!task) { |
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.
How is this possible? The parameter type is non-nullable / non-falsey.
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.
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.
I can make the task optional to make this clearer at least.
That is the bare minimum, yes.
The cause of this bug is likely related to the fact that task = this.task
may be undefined.
aws-toolkit-vscode/packages/amazonq/src/inlineChat/controller/inlineChatController.ts
Line 310 in 1153658
await this.updateTaskAndLenses(this.task, TaskState.WaitingForDecision) |
It's probably a good idea to track down the root cause, because this signals that there are other parts of the code that are forcing things (e.g. with !
) that they shouldn't be forcing. Or there is unclear initialization ordering.
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.
Is this code still missing tests?
The LineAnnotationController could get stuck showing the tutorial for new users due to changes in the inline chat logic, this PR resolve that bug and prevents the
aws.codewhisperer.tutorial.workInProgress
from being set totrue
when using inline chat.Additional a more descriptive error log for the
computeDiffAndRenderOnEditor
function call and check for not null inupdateTaskAndLenses
License: I confirm that my contribution is made under the terms of the Apache 2.0 license.