Skip to content

fix: drop any in abort controller#997

Open
ferhatelmas wants to merge 1 commit intomasterfrom
ferhat/abort-controller
Open

fix: drop any in abort controller#997
ferhatelmas wants to merge 1 commit intomasterfrom
ferhat/abort-controller

Conversation

@ferhatelmas
Copy link
Copy Markdown
Member

@ferhatelmas ferhatelmas commented Apr 9, 2026

What kind of change does this PR introduce?

Refactor

What is the current behavior?

Using any.

What is the new behavior?

No any. Event is also passed to listener as expected.

Additional context

It's more generic to handle event listener object as well and add new coverage for it.
Handle removing by capturing identity in weak map.

Related to #922, extracted for behavioral changes.

@ferhatelmas ferhatelmas requested a review from a team as a code owner April 9, 2026 15:58
Copilot AI review requested due to automatic review settings April 9, 2026 15:58
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Refactors the internal AsyncAbortController to eliminate any usage and to properly support both function listeners and EventListenerObject listeners while tracking abort-handler completion.

Changes:

  • Replaces Promise<any>[] with Promise<unknown>[] for stronger typing.
  • Binds and wraps AbortSignal.addEventListener to support EventListenerOrEventListenerObject and forward the Event argument.
  • Awaits async abort handlers by resolving a tracked promise per registered abort listener.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@coveralls
Copy link
Copy Markdown

coveralls commented Apr 9, 2026

Coverage Report for CI Build 24253550042

Coverage increased (+0.05%) to 80.882%

Details

  • Coverage increased (+0.05%) from the base build.
  • Patch coverage: 18 uncovered changes across 1 file (167 of 185 lines covered, 90.27%).
  • 3 coverage regressions across 1 file.

Uncovered Changes

File Changed Covered %
src/internal/concurrency/async-abort-controller.ts 185 167 90.27%

Coverage Regressions

3 previously-covered lines in 1 file lost coverage.

File Lines Losing Coverage Coverage
src/storage/protocols/tus/s3-locker.ts 3 88.57%

Coverage Stats

Coverage Status
Relevant Lines: 37544
Covered Lines: 30542
Line Coverage: 81.35%
Relevant Branches: 4186
Covered Branches: 3210
Branch Coverage: 76.68%
Branches in Coverage %: Yes
Coverage Strength: 318.33 hits per line

💛 - Coveralls

@ferhatelmas ferhatelmas force-pushed the ferhat/abort-controller branch 2 times, most recently from 4f3cea2 to 2ea7e4e Compare April 9, 2026 16:45
@ferhatelmas ferhatelmas requested a review from Copilot April 9, 2026 16:45
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ferhatelmas ferhatelmas force-pushed the ferhat/abort-controller branch from 2ea7e4e to 8a4fbff Compare April 10, 2026 13:55
Signed-off-by: ferhat elmas <elmas.ferhat@gmail.com>
@ferhatelmas ferhatelmas force-pushed the ferhat/abort-controller branch from 8a4fbff to e6eb0ce Compare April 10, 2026 16:39
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