-
Notifications
You must be signed in to change notification settings - Fork 634
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 not change original outputs #5609
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5609 +/- ##
==========================================
- Coverage 96.38% 96.01% -0.37%
==========================================
Files 466 466
Lines 37588 37590 +2
Branches 5541 5510 -31
==========================================
- Hits 36228 36091 -137
- Misses 1318 1457 +139
Partials 42 42 ☔ View full report in Codecov by Sentry. |
await abortableIterator.return(321), | ||
await normalIterator.return(321), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is still small difference in types of return
function argument between normalIterator
and abortableIterator
.
But this can't be fixed without changing AsyncIterable<T>
type.
denoland/deno#24837
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work. Can you please also move the return()
from the catch
block to a finally
block? I believe that should be the correct way to do it.
As you wish but this way, the function will be called twice if no exception occurs. |
In that case, we'd likely need to at a |
Sounds like the same thing can be achieved by calling |
I thought so too and thats exactly what I did in the first place. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apologies. What the catch
previously achieved didn't click with me. I've reverted that change now. Now, LGTM. Thank you.
Related to this PR: #5560
And this issue #3518