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

bug fix(amazonq): fix an issue where user action is accept but telemetry is reject #5319

Merged
merged 8 commits into from
Feb 4, 2025

Conversation

andrewyuq
Copy link
Contributor

@andrewyuq andrewyuq commented Feb 3, 2025

The shouldEditorCancelPopup variable should increment/decrement in-pair inside dontClosePopupAndRun logic and the CodeWhispererPopupIntelliSenseAcceptListener logic, but there was some race condition that makes CodeWhispererPopupIntelliSenseAcceptListener's setting false after dontClosePopupAndRun's setting true,

so now making it a semaphore-like val to make sure it was updated properly.

The common scenario is as follows:

  1. In the Amazon Q setting, change to "tab to prioritize accepting Q suggestions"
  2. User triggers, Q shows
  3. User types as it shows, Jetbrains suggesitons show (e.g. type p in java results in Jetbrains suggestion for public)
  4. press tab to accept
  5. The IntelliSense is closed, triggering lookupCancelled, but no item is selected so beforeItemSelected is not triggered to make it to false, (so a part of this fix is to make the beforeItemSelected logic to lookupShown logic and make it an int so it can be incremented twice so decrementing doesn't completely reset it.)
  6. A caret movement inside accept/insert suggestion logic causes the popup to cancel(and send reject events)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Description

Checklist

  • My code follows the code style of this project
  • I have added tests to cover my changes
  • A short description of the change has been added to the CHANGELOG if the change is customer-facing in the IDE.
  • I have added metrics for my changes (if required)

License

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

@andrewyuq andrewyuq requested a review from rli February 3, 2025 20:21
@andrewyuq andrewyuq requested a review from a team as a code owner February 3, 2025 20:21
@andrewyuq andrewyuq changed the title bug fix(amazonq): fix an issue where user action is accept but teleme… bug fix(amazonq): fix an issue where user action is accept but telemetry is reject Feb 3, 2025
@andrewyuq andrewyuq marked this pull request as draft February 3, 2025 23:08
@andrewyuq andrewyuq marked this pull request as ready for review February 3, 2025 23:34
@andrewyuq andrewyuq enabled auto-merge (squash) February 4, 2025 19:22
@andrewyuq andrewyuq merged commit f94910f into aws:main Feb 4, 2025
11 checks passed
KevinDing1 pushed a commit to KevinDing1/aws-toolkit-jetbrains that referenced this pull request Feb 6, 2025
…try is reject (aws#5319)

* bug fix(amazonq): fix an issue where user action is accept but telemetry is reject

* detekt

* fix increment logic when IntelliSense is showing up

* Change to use a semaphore
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