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 propagation of async hook ids through callbacks #1511

Merged
merged 2 commits into from
May 24, 2022

Conversation

alexanderfloh
Copy link
Contributor

Use Call instead of MakeCallback in order to retain the correct async-id through callbacks.

This is also recommended in the Node.js documentation:

Note it is not necessary to use napi_make_callback from within a napi_async_complete_callback; in that situation the callback's async context has already been set up, so a direct call to napi_call_function is sufficient and appropriate.
(https://nodejs.org/api/n-api.html#n_api_napi_make_callback)

@alexanderfloh
Copy link
Contributor Author

@kewde can you please consider this for merging? Thanks!

@daniellockyer
Copy link
Member

@alexanderfloh Would you be able to rebase the PR? 🙂

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