-
Notifications
You must be signed in to change notification settings - Fork 30k
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
executionAsyncId() reports parent context ID in new Promise(fn)
function
#37407
Comments
Here's a TAP-emitting test that you can use to comb through these. Note that the "expect" value seems to be the thing that's mistaken in the current node master branch, which is a huge step in the right direction! https://gist.github.com/isaacs/c8d15def6869ff738c69037155dda2c2 |
I think this might be due to the fact that a |
With the existing Promise Hooks types, I don't see any information/hooks given out to the embedder as to start and end points of the callback provided to the |
@sajal50 is correct. The function passed to In the end this is quite similar then callback based APIs, e.g. in |
new Promise(fn)
functionnew Promise(fn)
function
new Promise(fn)
functionnew Promise(fn)
function
Hm. That does make sense. It's a bit weird that the executionAsyncId changes between the throw and the catch there, but anywhere you put that boundary is going to be strange. And since the executionAsyncId refers to the promise itself in the error/rejection handler, that's fine for making |
What steps will reproduce the bug?
How often does it reproduce? Is there a required condition?
Always.
What is the expected behavior?
The
executionAsyncId
within thePromise
function should be that of the Promise itself, rather than the parent context.What do you see instead?
Additional information
Possibly related to #26794, not sure.
Note that the Promise constructor callback does report the proper executionAsyncId when the Promise is created in the context of a Promise chain.
The text was updated successfully, but these errors were encountered: