| 01:09 | <Steve Hicks> | The hope would be that it the active span is the one that actually closed the dialog that triggered the after() promise to resolve (and thus the callback to run). But since it's a Promise, we lose that context and (per every version of the spec we've considered) end up in the registration context that called then(). |
| 09:47 | <Chengzhong Wu> | I'd be curious how the library interprets the two spans, one that calls the dialog.after().then and one that triggered the dialog close event, are there any relationship between them? |
| 09:52 | <Chengzhong Wu> | My impression is that this is similar to https://github.com/WICG/observable?tab=readme-ov-file#concerns when wrapping an event handler in a promise and this handler will always been called in a new microtask, instead of the execution context when the event is been dispatched. If a library would like to avoid the microtask in this case but keep the .then API, it can return a thenable on after(), which invokes the handlers immediately, in the event's context. |