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): respond in chat right away when user enters JDK path #6275

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

dhasani23
Copy link
Contributor

@dhasani23 dhasani23 commented Dec 18, 2024

Problem

On a VS Code instance backed by CloudFront, when users enter their JDK path, it takes our chat 30+ seconds to respond.

Solution

Send a notification just before the build starts to also allow the other multiple chat messages to be sent.


  • Treat all work as PUBLIC. Private feature/x branches will not be squash-merged at release time.
  • Your code changes must meet the guidelines in CONTRIBUTING.md.
  • License: I confirm that my contribution is made under the terms of the Apache 2.0 license.

@dhasani23 dhasani23 requested review from a team as code owners December 18, 2024 22:41
Copy link

  • 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.

@dhasani23
Copy link
Contributor Author

dhasani23 commented Dec 18, 2024

Problem (on latest version of Q):

Screen.Recording.2024-12-18.at.2.38.20.PM.mov

Solution (this PR):

Screen.Recording.2024-12-18.at.2.39.47.PM.mov

@justinmk3
Copy link
Contributor

justinmk3 commented Dec 19, 2024

Sleep for 0.5s to allow the JDK path to be processed (i.e. we make sure it exists)

So users on fast systems must always wait 500ms?

And, what happens on systems where it takes longer than 500ms?

@dhasani23 dhasani23 marked this pull request as draft December 20, 2024 00:44
@@ -108,6 +108,7 @@ function copyProjectDependencies(dependenciesFolder: FolderInfo, modulePath: str
}

export async function prepareProjectDependencies(dependenciesFolder: FolderInfo, rootPomPath: string) {
void vscode.window.showInformationMessage(CodeWhispererConstants.buildStartedNotification)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We need this here anyway as an unrelated change, but still need to figure out a better solution besides sleeping for half a second

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It looks like the few chat messages which should be showing up one-at-a-time before the copyProjectDependencies and installProjectDependencies functions below start, are actually showing up all at once after both of these functions complete. I guess that means these 2 functions are blocking the event loop, which is why adding a small delay before they begin provides enough time for the queued chat messages to send. Haven't been able to find another solution besides adding this delay.

Downsides are that it does delay for all users, and unclear if 500ms will always be enough of a delay.

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