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

fix(async): abortable should prevent uncaught error when promise is rejected #6312

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Milly
Copy link
Contributor

@Milly Milly commented Dec 28, 2024

In abortable:

  • If the signal is aborted with delay and the promise is rejected, an uncaught error does not occur. This is OK.
  • If the signal is already aborted and the promise is rejected, an uncaught error occurs.

Uncaught errors should not occur in either case.

Also, I changed the tests to use delay instead of clearTimeout to detect leaks.

@Milly Milly requested a review from kt3k as a code owner December 28, 2024 17:01
@github-actions github-actions bot added the async label Dec 28, 2024
Copy link

codecov bot commented Dec 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.34%. Comparing base (c40f593) to head (8b1850a).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6312   +/-   ##
=======================================
  Coverage   96.33%   96.34%           
=======================================
  Files         547      547           
  Lines       41667    41667           
  Branches     6314     6314           
=======================================
+ Hits        40140    40144    +4     
+ Misses       1484     1481    -3     
+ Partials       43       42    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@kt3k
Copy link
Member

kt3k commented Jan 4, 2025

The fix looks good to me.

Also, I changed the tests to use delay instead of clearTimeout to detect leaks.

This change makes the test cases flaky like this one https://github.com/denoland/std/actions/runs/12528301271/job/34942765393

Can you revert these changes? (Timers are generally very unreliable in testing)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants