Skip to content

Fix propagation of async hook ids through callbacks#1511

Merged
daniellockyer merged 2 commits intoTryGhost:masterfrom
alexanderfloh:fix-async-hooking
May 24, 2022
Merged

Fix propagation of async hook ids through callbacks#1511
daniellockyer merged 2 commits intoTryGhost:masterfrom
alexanderfloh:fix-async-hooking

Conversation

@alexanderfloh
Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

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

@daniellockyer
Copy link
Copy Markdown
Contributor

@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