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 24202159189

Coverage increased (+0.05%) to 80.889%

Details

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

Uncovered Changes

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

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 37388
Covered Lines: 30421
Line Coverage: 81.37%
Relevant Branches: 4175
Covered Branches: 3199
Branch Coverage: 76.62%
Branches in Coverage %: Yes
Coverage Strength: 319.05 hits per line

💛 - Coveralls

@ferhatelmas ferhatelmas force-pushed the ferhat/abort-controller branch from efd1670 to 4f3cea2 Compare April 9, 2026 16:37
Signed-off-by: ferhat elmas <elmas.ferhat@gmail.com>
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.

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