-
Notifications
You must be signed in to change notification settings - Fork 310
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
Using async/await with thenables (non-native promises) loses the scope #654
Labels
bug
Something isn't working
Comments
@ignaciocavina Can you try with 0.15.0-beta.1 with the following option on the tracer? tracer.init({
experimental: {
thenables: true
}
}) This should fix the issue for Superagent and any other thenables by working around the limitation in Node. |
It worked!
I've updated my sample repo here:
https://github.com/ignaciocavina/atest-dd-trace-superagent/tree/test-with-0.15.0-beta.1
Thank you!
…On Thu, Aug 22, 2019 at 4:30 PM Roch Devost ***@***.***> wrote:
@ignaciocavina <https://github.com/ignaciocavina> Can you try with
0.15.0-beta.1 with the following option on the tracer?
tracer.init({
experimental: {
thenables: true
}
})
This should fix the issue for Superagent and any other thenables by
working around the limitation in Node.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#654?email_source=notifications&email_token=AAWVZ6EPA4OEIFBP47HCJCTQF3SOPA5CNFSM4IN2CST2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD46EQFY#issuecomment-524044311>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAWVZ6A5BDQJZAOVWFXVND3QF3SOPANCNFSM4IN2CSTQ>
.
--
*Ignacio Cavina* | Tech Master
*GLOBANT* | AR: +54 11 4109 1700 ext. 17511 | US: +1 877 215 5230 ext. 17511
|
[image: Facebook]
<http://globant.us4.list-manage1.com/track/click?u=5831a121b939d20e0735e21a1&id=b3661fedb8&e=b73a1bec72>
[image: Twitter]
<http://globant.us4.list-manage1.com/track/click?u=5831a121b939d20e0735e21a1&id=9a38a160e0&e=b73a1bec72>
[image: Youtube]
<http://globant.us4.list-manage2.com/track/click?u=5831a121b939d20e0735e21a1&id=2fcecb22a2&e=b73a1bec72>
[image: Linkedin]
<http://globant.us4.list-manage.com/track/click?u=5831a121b939d20e0735e21a1&id=9419b0d7e6&e=b73a1bec72>
[image: Pinterest]
<http://globant.us4.list-manage.com/track/click?u=5831a121b939d20e0735e21a1&id=4de8e506ce&e=b73a1bec72>
[image: Globant]
<http://globant.us4.list-manage2.com/track/click?u=5831a121b939d20e0735e21a1&id=d7879e1724&e=b73a1bec72>
--
The information contained in this e-mail may be confidential. It has been
sent for the sole use of the intended recipient(s). If the reader of this
message is not an intended recipient, you are hereby notified that any
unauthorized review, use, disclosure, dissemination, distribution or
copying of this communication, or any of its contents, is strictly
prohibited. If you have received it by mistake please let us know by e-mail
immediately and delete it from your system. Many thanks.
La información
contenida en este mensaje puede ser confidencial. Ha sido enviada para el
uso exclusivo del destinatario(s) previsto. Si el lector de este mensaje no
fuera el destinatario previsto, por el presente queda Ud. notificado que
cualquier lectura, uso, publicación, diseminación, distribución o copiado
de esta comunicación o su contenido está estrictamente prohibido. En caso
de que Ud. hubiera recibido este mensaje por error le agradeceremos
notificarnos por e-mail inmediatamente y eliminarlo de su sistema. Muchas
gracias.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
When using async/await with thenables (non-native promises) without explicitly calling
then
, it causes the scope to be lost. This is becauseawait
schedules the call tothen
on the next tick, at which point it's called in a different context, usually the native context which always has an ID of 0.This is a current limitation in Node which is unlikely to be resolved soon. A possible workaround is to call then before calling await, for example await request.get(url).then(x => x).
The text was updated successfully, but these errors were encountered: