Open jbellenger opened 8 years ago
This is by design, although there is a lot of debate as too the correct approach. There is currently an open issue on CLS discussig how promises should propagate contexts. The approach asl took was to propagate from resolution to callback rather than creation to callback. For example, if a promise wraps an api that makes a network request, the callback passed to then would be a child of that request rather than a sibling. This allows consumers of the asl api to trace causality. In the Promise.all case, the thing resolving the promise is the same thing as the last promise to resolve that was passed to Promise.all.
Async-listener will propagate contexts through Promise.all, which is different behavior from similar functionality in the domain module.
It's not 100% clear to me that this is a bug, though it is unexpected.
Test case:
Output: