00:28 | <Steve Hicks> | By "opt back into" I meant AsyncContext.Snapshot.wrap to handle the rare exception to the default - so not "us" opting in |
00:31 | <Steve Hicks> | Is the trace on event handler agnostic to event types? In implementations where instrument known event types, it can determine either creating a new root span, or creating a child span by event type semantics. element.click() or .focus() and that those cascading cases are treated as child spans, whereas a user-initiated click (or focus) would be treated as a root span (but with the same tree of children). In this case, having event handlers "do nothing" produces exactly the right behavior - user-initiated actions come in with an empty context, while synchronous events inherit the caller's context. |
06:43 | <littledan> | I think the question was about something else: do you have event-specific logic in your tracing system? Do we expect this to exist generally? The answer to this has significant impact on what kinds of API shapes would or wouldn’t work (even if you have identified one which would work). |
08:04 | <Steve Hicks> | Ah, I think it is probably event-specific, but I don't know exactly. I'll ask, though can you explain why it's such a significant impact? |
08:08 | <Steve Hicks> | Though, on second thought, the specificity could easily only be in the product code, rather than in the infrastructure. |
13:22 | <littledan> | Whether it is event-specific determines whether we could indicate important context in event-specific properties, as you had proposed, and have a bit of logic to fix things up with that information |
13:24 | <littledan> | This is really core because we know that different variables need different kinds of information flow. So, we are trying to figure out what the requirements are for this tracing variable (which is the motivation for all of the null context and flow-through discussion as far as I can tell) |
13:28 | <littledan> | Also, maybe you have some other system that you have been comparing AsyncContext to, and converting an existing tracing system to be based on AsyncContext? Can you tell us about this baseline and what its semantics are? |
14:18 | <Andreu Botella> | I was under the impression that choosing between initial context and registration context for user-sourced events would be trivial, but after thinking some more about it, I don't think it would be |
14:19 | <Andreu Botella> | after all, you could fire an event synchronously in an inline <script> , and that would have the initial context |
14:19 | <Andreu Botella> | so there would need to be extra browser code and spec text to somehow track when an event is user/browser-sourced |
15:15 | <Andreu Botella> | whoops, I was writing a long post in https://github.com/tc39/proposal-async-context/pull/100 and accidentally hit "close pull request" before finishing it |
15:28 | <Andreu Botella> | edited with the remainder of that message |
15:43 | <Steve Hicks> | Whether it is event-specific determines whether we could indicate important context in event-specific properties, as you had proposed, and have a bit of logic to fix things up with that information I think the difficulty here is two-fold: both third-party libraries and distant first-party developers are doing async things (e.g. listening on events, etc) on their own terms and in their own ways, and it's not reasonable to expect them to know whether and when they need to do special handling to propagate a non-default context, and there's no good way for the framework that cares about that propagation to stick itself in the way to make it happen the right way. This is independent of any event type, and (as far as I can tell at first glance) seems to require that we pick the "right default" from the start, since any incorrect default will break the flow. This is a lot of upfront work, but may not be infeasible. There's a large but finite number of events to consider, and a divide-and-conquer approach may make it possible within a few months...? I agree that changing this in the future is likely to be problematic, unless we could reasonably poison the context of not-yet-decided events, but I'm having trouble imagining how that could work reasonably. |
15:46 | <Andreu Botella> | I think at this point we should be involving more web platform folks in these conversations |
16:02 | <littledan> | we definitely need to be talking more with web platform folks, but (a) I'm not sure if we can get them to read our voluminous discussions, we probably need to come up with a condensed summary of thoughts (b) sometimes we can learn more from them in a small discussion than a big one--it's easier to be interactive that way. |
16:04 | <littledan> |
|