Fix: Cancel button now aborts in-flight text message requests#136
Merged
cnu1812 merged 1 commit intojenkinsci:mainfrom Feb 4, 2026
Merged
Fix: Cancel button now aborts in-flight text message requests#136cnu1812 merged 1 commit intojenkinsci:mainfrom
cnu1812 merged 1 commit intojenkinsci:mainfrom
Conversation
Signed-off-by: Divyansh Rai <140232173+divyansh-cyber@users.noreply.github.com>
Contributor
Author
|
@berviantoleo all checks have passed,Is there anything else you'd like me to adjust |
berviantoleo
approved these changes
Feb 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Cancel button did not abort in-flight text message requests. Only the timeout could stop them the AbortSignal from the UI was ignored. This PR fixes that by combining the caller’s signal with the timeout signal in callChatbotApi, so user cancel and timeout both abort the request.
Problem
callChatbotApi always used its own timeout AbortController, overwriting the caller’s options.signal.
Result: clicking Cancel didn’t abort text requests; they ran until completion or timeout.
Solution
Respect the caller’s options.signal.
Combine it with the timeout using AbortSignal.timeout() and AbortSignal.any().
Pass the combined (or timeout-only) signal to fetch so Cancel and timeout both work.
Changes
callChatbotApi.ts: Combine caller + timeout signals, pass to fetch, use strict AbortError check, remove manual timers.
callChatbotApi.test.ts: Add test to verify abort on caller signal.
Testing
Unit tests pass, including cancel test.
Fixes: #135