Skip to content

fix: reorder cancellation operations #1478

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

Merged
merged 1 commit into from
May 29, 2025
Merged

Conversation

tsmithsz
Copy link
Contributor

@tsmithsz tsmithsz commented May 29, 2025

Problem

When a user cancels an Amazon Q chat request, the current implementation prioritizes UI updates and telemetry before actually stopping the ongoing operations. This creates a delay in stopping processes and can lead to race conditions when follow-up prompts are sent.

Solution

Reordered the operations in the onCancellationRequested callback to prioritize aborting ongoing operations first, then update the UI, and finally send telemetry. This change ensures that when a user cancels a request:

  1. All operations are immediately aborted (highest priority)

  2. UI is updated to inform the user of the cancellation

  3. Telemetry is sent (lowest priority)

License

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@tsmithsz tsmithsz requested a review from a team as a code owner May 29, 2025 23:21
@tsmithsz tsmithsz merged commit 0d392a7 into aws:main May 29, 2025
6 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.

2 participants