Skip to content

Conversation

@evanliu048
Copy link
Contributor

@evanliu048 evanliu048 commented Jan 30, 2025

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Description

This PR improves the emitTelemetryOnSuggestion method in the CodeWhispererUserModificationTracker class. Specifically:

  • Added validation for RangeMarker to ensure it is valid before processing offsets.
  • Included checks for invalid offset ranges (e.g., startOffset or endOffset exceeding the document's length or being inconsistent).
  • Added logging for invalid scenarios to aid debugging.
  • Ensured graceful fallback by reporting telemetry with null modification percentage when encountering invalid ranges or documents.

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.

@evanliu048 evanliu048 requested review from a team as code owners January 30, 2025 20:25
@rli
Copy link
Contributor

rli commented Jan 31, 2025

#5187

@evanliu048 evanliu048 requested a review from rli February 1, 2025 00:48
@evanliu048 evanliu048 merged commit 02ec702 into aws:main Feb 3, 2025
11 checks passed
gandhi-21 pushed a commit to gandhi-21/aws-toolkit-jetbrains that referenced this pull request Feb 26, 2025
…t IndexOutOfBoundsException (aws#5312)

* add boundary check for userModificationTracker

* add chaneglog

* Update bugfix-24d6621e-32d3-45c5-a996-66232724e425.json

This reverts commit d9453ea.

---------

Co-authored-by: Richard Li <[email protected]>
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.

4 participants