22:34
<Steve Hicks>
Our tracing lead reached out to me today with a problem caused by a commonly-used API that uses promises for event handling - i.e. dialog.after().then(() => ...) - which of course makes it impossible to preserve the dispatch context when calling the "after" callbacks. I wonder to what extent this pattern is used externally? Our workaround is to deprecate the promise-based API and cut out the middle ).then(, so that you just pass the callback directly to after, but this is a pretty big migration. I don't see any other alternative, though, since it's pretty fundamental that promises shouldn't try to record their resolution context or something like that, which would lead to inconsistencies vs. await, etc. Is this something anyone else has run into and/or thought about?
22:37
<Chengzhong Wu>
What's this tracing library's semantic on dialog.after().then(() => /* what's the expected active span here */ ) ?
22:38
<Justin Ridgewell>
^ same question
22:39
<Justin Ridgewell>
I feel like it's pretty common to model a once event as a Promise instead of a .onfoo = () => {}