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

KTOR-7734 Do not abort fetch after its completion #4629

Merged
merged 1 commit into from
Jan 28, 2025
Merged

Conversation

osipxd
Copy link
Member

@osipxd osipxd commented Jan 27, 2025

Subsystem
Client (JS, WasmJS)

Motivation
KTOR-7734 "AbortError: BodyStreamBuffer was aborted" error when canceling parent job

Solution
The problem was caused by calling controller.abort() after request fetching was already completed (together with its coroutine). It resulted in propagation of this exception to the global level without any possibility to catch it.

Unfortunately, I didn't manage to write a test for this case.

@osipxd osipxd requested review from e5l and bjhham January 27, 2025 15:46
@osipxd osipxd self-assigned this Jan 27, 2025
Copy link
Member

@e5l e5l left a comment

Choose a reason for hiding this comment

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

Nice, LGTM!

Copy link
Contributor

@bjhham bjhham left a comment

Choose a reason for hiding this comment

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

Nice find

@osipxd osipxd merged commit 5ff1a3c into main Jan 28, 2025
16 checks passed
@osipxd osipxd deleted the osipxd/js-abort-error branch January 28, 2025 08:46
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