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

fix(amazonq): tutorial always showing on start #5949

Merged
merged 2 commits into from
Nov 12, 2024

Conversation

grant0417
Copy link
Member

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 to true when using inline chat.

Additional a more descriptive error log for the computeDiffAndRenderOnEditor function call and check for not null in updateTaskAndLenses

License: I confirm that my contribution is made under the terms of the Apache 2.0 license.

@grant0417 grant0417 requested review from a team as code owners November 7, 2024 19:08
Copy link

github-actions bot commented Nov 7, 2024

  • This pull request modifies code in src/* but no tests were added/updated.
    • Confirm whether tests should be added or ensure the PR description explains why tests are not required.

@@ -122,6 +122,9 @@ export class InlineChatController {
}

public async updateTaskAndLenses(task: InlineTask, taskState?: TaskState) {
if (!task) {
Copy link
Contributor

@justinmk3 justinmk3 Nov 8, 2024

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.

Copy link
Member Author

Choose a reason for hiding this comment

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

Unclear when this could happen. This is an attempt to fix an issue reported by a customer where I believe the logic in this function is running with a undefined task, I can not find any other codepath that would produce this error:

Screenshot 2024-11-12 at 9 09 30 AM

I can make the task optional to make this clearer at least.

Copy link
Contributor

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.

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.

Copy link
Contributor

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?

@justinmk3 justinmk3 changed the title fix(amazonq): Resolve tutorial always showing on start fix(amazonq): tutorial always showing on start Nov 8, 2024
@justinmk3 justinmk3 merged commit 1c1fb06 into aws:master Nov 12, 2024
22 of 25 checks passed
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.

3 participants